resources

package
v1.9.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContentTypeApplicationJSON

func WithContentTypeApplicationJSON(r *runtime.ClientOperation)

WithContentTypeApplicationJSON sets the Content-Type header to "application/json".

func WithContentTypeTextPlain

func WithContentTypeTextPlain(r *runtime.ClientOperation)

WithContentTypeTextPlain sets the Content-Type header to "text/plain".

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for resources API

func (*Client) CreateResource

func (a *Client) CreateResource(params *CreateResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateResourceCreated, error)

CreateResource creates resources

Create one or more Kargo resources from YAML or JSON manifests.

func (*Client) DeleteResource

func (a *Client) DeleteResource(params *DeleteResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteResourceOK, error)
DeleteResource deletes resources

Delete one or more Kargo resources using namespaces and names

obtained from YAML or JSON manifests.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

func (*Client) UpdateResource

func (a *Client) UpdateResource(params *UpdateResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateResourceOK, error)

UpdateResource updates resources

Update (or optionally, upsert) one or more Kargo resources from

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption may be used to customize the behavior of Client methods.

func WithContentType

func WithContentType(mime string) ClientOption

WithContentType allows the client to force the Content-Type header to negotiate a specific Consumer from the server.

You may use this option to set arbitrary extensions to your MIME media type.

type ClientService

type ClientService interface {
	CreateResource(params *CreateResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateResourceCreated, error)

	DeleteResource(params *DeleteResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteResourceOK, error)

	UpdateResource(params *UpdateResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateResourceOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new resources API client.

func NewClientWithBasicAuth

func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService

New creates a new resources API client with basic auth credentials. It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - user: user for basic authentication header. - password: password for basic authentication header.

func NewClientWithBearerToken

func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService

New creates a new resources API client with a bearer token for authentication. It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - bearerToken: bearer token for Bearer authentication header.

type CreateResourceCreated

type CreateResourceCreated struct {
	Payload *models.CreateResourceResponse
}

CreateResourceCreated describes a response with status code 201, with default header values.

Created successfully

func NewCreateResourceCreated

func NewCreateResourceCreated() *CreateResourceCreated

NewCreateResourceCreated creates a CreateResourceCreated with default headers values

func (*CreateResourceCreated) Code

func (o *CreateResourceCreated) Code() int

Code gets the status code for the create resource created response

func (*CreateResourceCreated) Error

func (o *CreateResourceCreated) Error() string

func (*CreateResourceCreated) GetPayload

func (*CreateResourceCreated) IsClientError

func (o *CreateResourceCreated) IsClientError() bool

IsClientError returns true when this create resource created response has a 4xx status code

func (*CreateResourceCreated) IsCode

func (o *CreateResourceCreated) IsCode(code int) bool

IsCode returns true when this create resource created response a status code equal to that given

func (*CreateResourceCreated) IsRedirect

func (o *CreateResourceCreated) IsRedirect() bool

IsRedirect returns true when this create resource created response has a 3xx status code

func (*CreateResourceCreated) IsServerError

func (o *CreateResourceCreated) IsServerError() bool

IsServerError returns true when this create resource created response has a 5xx status code

func (*CreateResourceCreated) IsSuccess

func (o *CreateResourceCreated) IsSuccess() bool

IsSuccess returns true when this create resource created response has a 2xx status code

func (*CreateResourceCreated) String

func (o *CreateResourceCreated) String() string

type CreateResourceParams

type CreateResourceParams struct {

	/* Manifest.

	   YAML or JSON manifest(s)
	*/
	Manifest string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

CreateResourceParams contains all the parameters to send to the API endpoint

for the create resource operation.

Typically these are written to a http.Request.

func NewCreateResourceParams

func NewCreateResourceParams() *CreateResourceParams

NewCreateResourceParams creates a new CreateResourceParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewCreateResourceParamsWithContext

func NewCreateResourceParamsWithContext(ctx context.Context) *CreateResourceParams

NewCreateResourceParamsWithContext creates a new CreateResourceParams object with the ability to set a context for a request.

func NewCreateResourceParamsWithHTTPClient

func NewCreateResourceParamsWithHTTPClient(client *http.Client) *CreateResourceParams

NewCreateResourceParamsWithHTTPClient creates a new CreateResourceParams object with the ability to set a custom HTTPClient for a request.

func NewCreateResourceParamsWithTimeout

func NewCreateResourceParamsWithTimeout(timeout time.Duration) *CreateResourceParams

NewCreateResourceParamsWithTimeout creates a new CreateResourceParams object with the ability to set a timeout on a request.

func (*CreateResourceParams) SetContext

func (o *CreateResourceParams) SetContext(ctx context.Context)

SetContext adds the context to the create resource params

func (*CreateResourceParams) SetDefaults

func (o *CreateResourceParams) SetDefaults()

SetDefaults hydrates default values in the create resource params (not the query body).

All values with no default are reset to their zero value.

func (*CreateResourceParams) SetHTTPClient

func (o *CreateResourceParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the create resource params

func (*CreateResourceParams) SetManifest

func (o *CreateResourceParams) SetManifest(manifest string)

SetManifest adds the manifest to the create resource params

func (*CreateResourceParams) SetTimeout

func (o *CreateResourceParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the create resource params

func (*CreateResourceParams) WithContext

WithContext adds the context to the create resource params

func (*CreateResourceParams) WithDefaults

func (o *CreateResourceParams) WithDefaults() *CreateResourceParams

WithDefaults hydrates default values in the create resource params (not the query body).

All values with no default are reset to their zero value.

func (*CreateResourceParams) WithHTTPClient

func (o *CreateResourceParams) WithHTTPClient(client *http.Client) *CreateResourceParams

WithHTTPClient adds the HTTPClient to the create resource params

func (*CreateResourceParams) WithManifest

func (o *CreateResourceParams) WithManifest(manifest string) *CreateResourceParams

WithManifest adds the manifest to the create resource params

func (*CreateResourceParams) WithTimeout

func (o *CreateResourceParams) WithTimeout(timeout time.Duration) *CreateResourceParams

WithTimeout adds the timeout to the create resource params

func (*CreateResourceParams) WriteToRequest

func (o *CreateResourceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type CreateResourceReader

type CreateResourceReader struct {
	// contains filtered or unexported fields
}

CreateResourceReader is a Reader for the CreateResource structure.

func (*CreateResourceReader) ReadResponse

func (o *CreateResourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error)

ReadResponse reads a server response into the received o.

type DeleteResourceOK

type DeleteResourceOK struct {
	Payload *models.DeleteResourceResponse
}

DeleteResourceOK describes a response with status code 200, with default header values.

OK

func NewDeleteResourceOK

func NewDeleteResourceOK() *DeleteResourceOK

NewDeleteResourceOK creates a DeleteResourceOK with default headers values

func (*DeleteResourceOK) Code

func (o *DeleteResourceOK) Code() int

Code gets the status code for the delete resource o k response

func (*DeleteResourceOK) Error

func (o *DeleteResourceOK) Error() string

func (*DeleteResourceOK) GetPayload

func (*DeleteResourceOK) IsClientError

func (o *DeleteResourceOK) IsClientError() bool

IsClientError returns true when this delete resource o k response has a 4xx status code

func (*DeleteResourceOK) IsCode

func (o *DeleteResourceOK) IsCode(code int) bool

IsCode returns true when this delete resource o k response a status code equal to that given

func (*DeleteResourceOK) IsRedirect

func (o *DeleteResourceOK) IsRedirect() bool

IsRedirect returns true when this delete resource o k response has a 3xx status code

func (*DeleteResourceOK) IsServerError

func (o *DeleteResourceOK) IsServerError() bool

IsServerError returns true when this delete resource o k response has a 5xx status code

func (*DeleteResourceOK) IsSuccess

func (o *DeleteResourceOK) IsSuccess() bool

IsSuccess returns true when this delete resource o k response has a 2xx status code

func (*DeleteResourceOK) String

func (o *DeleteResourceOK) String() string