product

package
v0.0.0-...-2afdb13 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAcceptApplicationJSON

func WithAcceptApplicationJSON(r *runtime.ClientOperation)

WithAcceptApplicationJSON sets the Accept header to "application/json".

func WithAcceptApplicationXML

func WithAcceptApplicationXML(r *runtime.ClientOperation)

WithAcceptApplicationXML sets the Accept header to "application/xml".

func WithAcceptTextJSON

func WithAcceptTextJSON(r *runtime.ClientOperation)

WithAcceptTextJSON sets the Accept header to "text/json".

func WithAcceptTextXML

func WithAcceptTextXML(r *runtime.ClientOperation)

WithAcceptTextXML sets the Accept header to "text/xml".

func WithContentTypeApplicationJSON

func WithContentTypeApplicationJSON(r *runtime.ClientOperation)

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

func WithContentTypeApplicationXML

func WithContentTypeApplicationXML(r *runtime.ClientOperation)

WithContentTypeApplicationXML sets the Content-Type header to "application/xml".

func WithContentTypeApplicationxWwwFormUrlencoded

func WithContentTypeApplicationxWwwFormUrlencoded(r *runtime.ClientOperation)

WithContentTypeApplicationxWwwFormUrlencoded sets the Content-Type header to "application/x-www-form-urlencoded".

func WithContentTypeTextJSON

func WithContentTypeTextJSON(r *runtime.ClientOperation)

WithContentTypeTextJSON sets the Content-Type header to "text/json".

func WithContentTypeTextXML

func WithContentTypeTextXML(r *runtime.ClientOperation)

WithContentTypeTextXML sets the Content-Type header to "text/xml".

Types

type Client

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

Client for product API

func (*Client) ProductGetProduct

func (a *Client) ProductGetProduct(params *ProductGetProductParams, opts ...ClientOption) (*ProductGetProductOK, error)

ProductGetProduct gets a specific product

func (*Client) ProductGetProducts

func (a *Client) ProductGetProducts(params *ProductGetProductsParams, opts ...ClientOption) (*ProductGetProductsOK, error)

ProductGetProducts gets a list of products

func (*Client) ProductPostProduct

func (a *Client) ProductPostProduct(params *ProductPostProductParams, opts ...ClientOption) (*ProductPostProductOK, error)

ProductPostProduct creates a new product of update an existing product

func (*Client) SetTransport

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

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

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

func WithAccept

func WithAccept(mime string) ClientOption

WithAccept allows the client to force the Accept header to negotiate a specific Producer from the server.

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

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 {
	ProductGetProduct(params *ProductGetProductParams, opts ...ClientOption) (*ProductGetProductOK, error)

	ProductGetProducts(params *ProductGetProductsParams, opts ...ClientOption) (*ProductGetProductsOK, error)

	ProductPostProduct(params *ProductPostProductParams, opts ...ClientOption) (*ProductPostProductOK, 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 product API client.

func NewClientWithBasicAuth

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

New creates a new product 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 product 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 ProductGetProductOK

type ProductGetProductOK struct {
	Payload *model.Product
}

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

Get a product

func NewProductGetProductOK

func NewProductGetProductOK() *ProductGetProductOK

NewProductGetProductOK creates a ProductGetProductOK with default headers values

func (*ProductGetProductOK) Code

func (o *ProductGetProductOK) Code() int

Code gets the status code for the product get product o k response

func (*ProductGetProductOK) Error

func (o *ProductGetProductOK) Error() string

func (*ProductGetProductOK) GetPayload

func (o *ProductGetProductOK) GetPayload() *model.Product

func (*ProductGetProductOK) IsClientError

func (o *ProductGetProductOK) IsClientError() bool

IsClientError returns true when this product get product o k response has a 4xx status code

func (*ProductGetProductOK) IsCode

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

IsCode returns true when this product get product o k response a status code equal to that given

func (*ProductGetProductOK) IsRedirect

func (o *ProductGetProductOK) IsRedirect() bool

IsRedirect returns true when this product get product o k response has a 3xx status code

func (*ProductGetProductOK) IsServerError

func (o *ProductGetProductOK) IsServerError() bool

IsServerError returns true when this product get product o k response has a 5xx status code

func (*ProductGetProductOK) IsSuccess

func (o *ProductGetProductOK) IsSuccess() bool

IsSuccess returns true when this product get product o k response has a 2xx status code

func (*ProductGetProductOK) String

func (o *ProductGetProductOK) String() string

type ProductGetProductParams

type ProductGetProductParams struct {

	// ProductID.
	//
	// Format: int32
	ProductID int32

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

ProductGetProductParams contains all the parameters to send to the API endpoint

for the product get product operation.

Typically these are written to a http.Request.

func NewProductGetProductParams

func NewProductGetProductParams() *ProductGetProductParams

NewProductGetProductParams creates a new ProductGetProductParams 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 NewProductGetProductParamsWithContext

func NewProductGetProductParamsWithContext(ctx context.Context) *ProductGetProductParams

NewProductGetProductParamsWithContext creates a new ProductGetProductParams object with the ability to set a context for a request.

func NewProductGetProductParamsWithHTTPClient

func NewProductGetProductParamsWithHTTPClient(client *http.Client) *ProductGetProductParams

NewProductGetProductParamsWithHTTPClient creates a new ProductGetProductParams object with the ability to set a custom HTTPClient for a request.

func NewProductGetProductParamsWithTimeout

func NewProductGetProductParamsWithTimeout(timeout time.Duration) *ProductGetProductParams

NewProductGetProductParamsWithTimeout creates a new ProductGetProductParams object with the ability to set a timeout on a request.

func (*ProductGetProductParams) SetContext

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

SetContext adds the context to the product get product params

func (*ProductGetProductParams) SetDefaults

func (o *ProductGetProductParams) SetDefaults()

SetDefaults hydrates default values in the product get product params (not the query body).

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

func (*ProductGetProductParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the product get product params

func (*ProductGetProductParams) SetProductID

func (o *ProductGetProductParams) SetProductID(productID int32)

SetProductID adds the productId to the product get product params

func (*ProductGetProductParams) SetTimeout

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

SetTimeout adds the timeout to the product get product params

func (*ProductGetProductParams) WithContext

WithContext adds the context to the product get product params

func (*ProductGetProductParams) WithDefaults

WithDefaults hydrates default values in the product get product params (not the query body).

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

func (*ProductGetProductParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the product get product params

func (*ProductGetProductParams) WithProductID

func (o *ProductGetProductParams) WithProductID(productID int32) *ProductGetProductParams

WithProductID adds the productID to the product get product params

func (*ProductGetProductParams) WithTimeout

WithTimeout adds the timeout to the product get product params

func (*ProductGetProductParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type ProductGetProductReader

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

ProductGetProductReader is a Reader for the ProductGetProduct structure.

func (*ProductGetProductReader) ReadResponse

func (o *ProductGetProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type ProductGetProductsOK

type ProductGetProductsOK struct {
	Payload []*model.Product
}

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

Get a list of products

func NewProductGetProductsOK

func NewProductGetProductsOK() *ProductGetProductsOK

NewProductGetProductsOK creates a ProductGetProductsOK with default headers values

func (*ProductGetProductsOK) Code

func (o *ProductGetProductsOK) Code() int

Code gets the status code for the product get products o k response

func (*ProductGetProductsOK) Error

func (o *ProductGetProductsOK) Error() string

func (*ProductGetProductsOK) GetPayload

func (o *ProductGetProductsOK) GetPayload() []*model.Product

func (*ProductGetProductsOK) IsClientError

func (o *ProductGetProductsOK) IsClientError() bool

IsClientError returns true when this product get products o k response has a 4xx status code

func (*ProductGetProductsOK) IsCode

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

IsCode returns true when this product get products o k response a status code equal to that given

func (*ProductGetProductsOK) IsRedirect

func (o *ProductGetProductsOK) IsRedirect() bool

IsRedirect returns true when this product get products o k response has a 3xx status code

func (*ProductGetProductsOK) IsServerError

func (o *ProductGetProductsOK) IsServerError() bool

IsServerError returns true when this product get products o k response has a 5xx status code

func (*ProductGetProductsOK) IsSuccess

func (o *ProductGetProductsOK) IsSuccess() bool

IsSuccess returns true when this product get products o k response has a 2xx status code

func (*ProductGetProductsOK) String

func (o *ProductGetProductsOK) String() string

type ProductGetProductsParams

type ProductGetProductsParams struct {
	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

ProductGetProductsParams contains all the parameters to send to the API endpoint

for the product get products operation.

Typically these are written to a http.Request.

func NewProductGetProductsParams

func NewProductGetProductsParams() *ProductGetProductsParams

NewProductGetProductsParams creates a new ProductGetProductsParams 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 NewProductGetProductsParamsWithContext

func NewProductGetProductsParamsWithContext(ctx context.Context) *ProductGetProductsParams

NewProductGetProductsParamsWithContext creates a new ProductGetProductsParams object with the ability to set a context for a request.

func NewProductGetProductsParamsWithHTTPClient

func NewProductGetProductsParamsWithHTTPClient(client *http.Client) *ProductGetProductsParams

NewProductGetProductsParamsWithHTTPClient creates a new ProductGetProductsParams object with the ability to set a custom HTTPClient for a request.

func NewProductGetProductsParamsWithTimeout

func NewProductGetProductsParamsWithTimeout(timeout time.Duration) *ProductGetProductsParams

NewProductGetProductsParamsWithTimeout creates a new ProductGetProductsParams object with the ability to set a timeout on a request.

func (*ProductGetProductsParams) SetContext

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

SetContext adds the context to the product get products params

func (*ProductGetProductsParams) SetDefaults

func (o *ProductGetProductsParams) SetDefaults()

SetDefaults hydrates default values in the product get products params (not the query body).

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

func (*ProductGetProductsParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the product get products params

func (*ProductGetProductsParams) SetTimeout

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

SetTimeout adds the timeout to the product get products params

func (*ProductGetProductsParams) WithContext

WithContext adds the context to the product get products params

func (*ProductGetProductsParams) WithDefaults

WithDefaults hydrates default values in the product get products params (not the query body).

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

func (*ProductGetProductsParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the product get products params

func (*ProductGetProductsParams) WithTimeout

WithTimeout adds the timeout to the product get products params

func (*ProductGetProductsParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type ProductGetProductsReader

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

ProductGetProductsReader is a Reader for the ProductGetProducts structure.

func (*ProductGetProductsReader) ReadResponse

func (o *ProductGetProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type ProductPostProductOK

type ProductPostProductOK struct {
	Payload int32
}

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

Save a product

func NewProductPostProductOK

func NewProductPostProductOK() *ProductPostProductOK

NewProductPostProductOK creates a ProductPostProductOK with default headers values

func (*ProductPostProductOK) Code

func (o *ProductPostProductOK) Code() int

Code gets the status code for the product post product o k response

func (*ProductPostProductOK) Error

func (o *ProductPostProductOK) Error() string

func (*ProductPostProductOK) GetPayload

func (o *ProductPostProductOK) GetPayload() int32

func (*ProductPostProductOK) IsClientError

func (o *ProductPostProductOK) IsClientError() bool

IsClientError returns true when this product post product o k response has a 4xx status code

func (*ProductPostProductOK) IsCode

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

IsCode returns true when this product post product o k response a status code equal to that given

func (*ProductPostProductOK) IsRedirect

func (o *ProductPostProductOK) IsRedirect() bool

IsRedirect returns true when this product post product o k response has a 3xx status code

func (*ProductPostProductOK) IsServerError

func (o *ProductPostProductOK) IsServerError() bool

IsServerError returns true when this product post product o k response has a 5xx status code

func (*ProductPostProductOK) IsSuccess

func (o *ProductPostProductOK) IsSuccess() bool

IsSuccess returns true when this product post product o k response has a 2xx status code

func (*ProductPostProductOK) String

func (o *ProductPostProductOK) String() string

type ProductPostProductParams

type ProductPostProductParams struct {

	// Product.
	Product *model.Product

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

ProductPostProductParams contains all the parameters to send to the API endpoint

for the product post product operation.

Typically these are written to a http.Request.

func NewProductPostProductParams

func NewProductPostProductParams() *ProductPostProductParams

NewProductPostProductParams creates a new ProductPostProductParams 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 NewProductPostProductParamsWithContext

func NewProductPostProductParamsWithContext(ctx context.Context) *ProductPostProductParams

NewProductPostProductParamsWithContext creates a new ProductPostProductParams object with the ability to set a context for a request.

func NewProductPostProductParamsWithHTTPClient

func NewProductPostProductParamsWithHTTPClient(client *http.Client) *ProductPostProductParams

NewProductPostProductParamsWithHTTPClient creates a new ProductPostProductParams object with the ability to set a custom HTTPClient for a request.

func NewProductPostProductParamsWithTimeout

func NewProductPostProductParamsWithTimeout(timeout time.Duration) *ProductPostProductParams

NewProductPostProductParamsWithTimeout creates a new ProductPostProductParams object with the ability to set a timeout on a request.

func (*ProductPostProductParams) SetContext

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

SetContext adds the context to the product post product params

func (*ProductPostProductParams) SetDefaults

func (o *ProductPostProductParams) SetDefaults()

SetDefaults hydrates default values in the product post product params (not the query body).

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

func (*ProductPostProductParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the product post product params

func (*ProductPostProductParams) SetProduct

func (o *ProductPostProductParams) SetProduct(product *model.Product)

SetProduct adds the product to the product post product params

func (*ProductPostProductParams) SetTimeout

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

SetTimeout adds the timeout to the product post product params

func (*ProductPostProductParams) WithContext

WithContext adds the context to the product post product params

func (*ProductPostProductParams) WithDefaults

WithDefaults hydrates default values in the product post product params (not the query body).

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

func (*ProductPostProductParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the product post product params

func (*ProductPostProductParams) WithProduct

WithProduct adds the product to the product post product params

func (*ProductPostProductParams) WithTimeout

WithTimeout adds the timeout to the product post product params

func (*ProductPostProductParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type ProductPostProductReader

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

ProductPostProductReader is a Reader for the ProductPostProduct structure.

func (*ProductPostProductReader) ReadResponse

func (o *ProductPostProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL