Documentation
¶
Index ¶
- type API
- type AddProductBadRequest
- type AddProductConflict
- type AddProductCreated
- type AddProductInternalServerError
- type AddProductParams
- func (o *AddProductParams) SetContext(ctx context.Context)
- func (o *AddProductParams) SetHTTPClient(client *http.Client)
- func (o *AddProductParams) SetProduct(product *models.Product)
- func (o *AddProductParams) SetTimeout(timeout time.Duration)
- func (o *AddProductParams) WithContext(ctx context.Context) *AddProductParams
- func (o *AddProductParams) WithHTTPClient(client *http.Client) *AddProductParams
- func (o *AddProductParams) WithProduct(product *models.Product) *AddProductParams
- func (o *AddProductParams) WithTimeout(timeout time.Duration) *AddProductParams
- func (o *AddProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type AddProductReader
- type Client
- func (a *Client) AddProduct(ctx context.Context, params *AddProductParams) (*AddProductCreated, error)
- func (a *Client) GetProduct(ctx context.Context, params *GetProductParams) (*GetProductOK, error)
- func (a *Client) ListProducts(ctx context.Context, params *ListProductsParams) (*ListProductsOK, error)
- func (a *Client) UpdateProduct(ctx context.Context, params *UpdateProductParams) (*UpdateProductOK, error)
- type GetProductInternalServerError
- type GetProductNotFound
- type GetProductOK
- type GetProductParams
- func (o *GetProductParams) SetContext(ctx context.Context)
- func (o *GetProductParams) SetHTTPClient(client *http.Client)
- func (o *GetProductParams) SetID(id string)
- func (o *GetProductParams) SetTimeout(timeout time.Duration)
- func (o *GetProductParams) WithContext(ctx context.Context) *GetProductParams
- func (o *GetProductParams) WithHTTPClient(client *http.Client) *GetProductParams
- func (o *GetProductParams) WithID(id string) *GetProductParams
- func (o *GetProductParams) WithTimeout(timeout time.Duration) *GetProductParams
- func (o *GetProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type GetProductReader
- type ListProductsInternalServerError
- type ListProductsOK
- type ListProductsParams
- func (o *ListProductsParams) SetContext(ctx context.Context)
- func (o *ListProductsParams) SetHTTPClient(client *http.Client)
- func (o *ListProductsParams) SetTimeout(timeout time.Duration)
- func (o *ListProductsParams) WithContext(ctx context.Context) *ListProductsParams
- func (o *ListProductsParams) WithHTTPClient(client *http.Client) *ListProductsParams
- func (o *ListProductsParams) WithTimeout(timeout time.Duration) *ListProductsParams
- func (o *ListProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type ListProductsReader
- type UpdateProductInternalServerError
- type UpdateProductNotFound
- type UpdateProductOK
- type UpdateProductParams
- func (o *UpdateProductParams) SetContext(ctx context.Context)
- func (o *UpdateProductParams) SetHTTPClient(client *http.Client)
- func (o *UpdateProductParams) SetID(id string)
- func (o *UpdateProductParams) SetProduct(product *models.Product)
- func (o *UpdateProductParams) SetTimeout(timeout time.Duration)
- func (o *UpdateProductParams) WithContext(ctx context.Context) *UpdateProductParams
- func (o *UpdateProductParams) WithHTTPClient(client *http.Client) *UpdateProductParams
- func (o *UpdateProductParams) WithID(id string) *UpdateProductParams
- func (o *UpdateProductParams) WithProduct(product *models.Product) *UpdateProductParams
- func (o *UpdateProductParams) WithTimeout(timeout time.Duration) *UpdateProductParams
- func (o *UpdateProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type UpdateProductReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
/*
AddProduct inserts a new product in the system*/
AddProduct(ctx context.Context, params *AddProductParams) (*AddProductCreated, error)
/*
GetProduct returns the information about the product with the given id*/
GetProduct(ctx context.Context, params *GetProductParams) (*GetProductOK, error)
/*
ListProducts lists all the products in the system*/
ListProducts(ctx context.Context, params *ListProductsParams) (*ListProductsOK, error)
/*
UpdateProduct updates the information of the product with the given id*/
UpdateProduct(ctx context.Context, params *UpdateProductParams) (*UpdateProductOK, error)
}
API is the interface of the product management client
type AddProductBadRequest ¶
type AddProductBadRequest struct {
}
AddProductBadRequest handles this case with default header values.
Invalid input, object invalid
func NewAddProductBadRequest ¶
func NewAddProductBadRequest() *AddProductBadRequest
NewAddProductBadRequest creates a AddProductBadRequest with default headers values
func (*AddProductBadRequest) Error ¶
func (o *AddProductBadRequest) Error() string
type AddProductConflict ¶
type AddProductConflict struct {
Payload *models.ErrorResponse
}
AddProductConflict handles this case with default header values.
The given item already exists
func NewAddProductConflict ¶
func NewAddProductConflict() *AddProductConflict
NewAddProductConflict creates a AddProductConflict with default headers values
func (*AddProductConflict) Error ¶
func (o *AddProductConflict) Error() string
func (*AddProductConflict) GetPayload ¶
func (o *AddProductConflict) GetPayload() *models.ErrorResponse
type AddProductCreated ¶
type AddProductCreated struct {
Payload *models.ItemCreatedResponse
}
AddProductCreated handles this case with default header values.
New product was added successfully
func NewAddProductCreated ¶
func NewAddProductCreated() *AddProductCreated
NewAddProductCreated creates a AddProductCreated with default headers values
func (*AddProductCreated) Error ¶
func (o *AddProductCreated) Error() string
func (*AddProductCreated) GetPayload ¶
func (o *AddProductCreated) GetPayload() *models.ItemCreatedResponse
type AddProductInternalServerError ¶
type AddProductInternalServerError struct {
Payload *models.ErrorResponse
}
AddProductInternalServerError handles this case with default header values.
Something unexpected happend, error raised
func NewAddProductInternalServerError ¶
func NewAddProductInternalServerError() *AddProductInternalServerError
NewAddProductInternalServerError creates a AddProductInternalServerError with default headers values
func (*AddProductInternalServerError) Error ¶
func (o *AddProductInternalServerError) Error() string
func (*AddProductInternalServerError) GetPayload ¶
func (o *AddProductInternalServerError) GetPayload() *models.ErrorResponse
type AddProductParams ¶
type AddProductParams struct {
/*Product
Product to be added
*/
Product *models.Product
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
AddProductParams contains all the parameters to send to the API endpoint for the add product operation typically these are written to a http.Request
func NewAddProductParams ¶
func NewAddProductParams() *AddProductParams
NewAddProductParams creates a new AddProductParams object with the default values initialized.
func NewAddProductParamsWithContext ¶
func NewAddProductParamsWithContext(ctx context.Context) *AddProductParams
NewAddProductParamsWithContext creates a new AddProductParams object with the default values initialized, and the ability to set a context for a request
func NewAddProductParamsWithHTTPClient ¶
func NewAddProductParamsWithHTTPClient(client *http.Client) *AddProductParams
NewAddProductParamsWithHTTPClient creates a new AddProductParams object with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewAddProductParamsWithTimeout ¶
func NewAddProductParamsWithTimeout(timeout time.Duration) *AddProductParams
NewAddProductParamsWithTimeout creates a new AddProductParams object with the default values initialized, and the ability to set a timeout on a request
func (*AddProductParams) SetContext ¶
func (o *AddProductParams) SetContext(ctx context.Context)
SetContext adds the context to the add product params
func (*AddProductParams) SetHTTPClient ¶
func (o *AddProductParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the add product params
func (*AddProductParams) SetProduct ¶
func (o *AddProductParams) SetProduct(product *models.Product)
SetProduct adds the product to the add product params
func (*AddProductParams) SetTimeout ¶
func (o *AddProductParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the add product params
func (*AddProductParams) WithContext ¶
func (o *AddProductParams) WithContext(ctx context.Context) *AddProductParams
WithContext adds the context to the add product params
func (*AddProductParams) WithHTTPClient ¶
func (o *AddProductParams) WithHTTPClient(client *http.Client) *AddProductParams
WithHTTPClient adds the HTTPClient to the add product params
func (*AddProductParams) WithProduct ¶
func (o *AddProductParams) WithProduct(product *models.Product) *AddProductParams
WithProduct adds the product to the add product params
func (*AddProductParams) WithTimeout ¶
func (o *AddProductParams) WithTimeout(timeout time.Duration) *AddProductParams
WithTimeout adds the timeout to the add product params
func (*AddProductParams) WriteToRequest ¶
func (o *AddProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type AddProductReader ¶
type AddProductReader struct {
// contains filtered or unexported fields
}
AddProductReader is a Reader for the AddProduct structure.
func (*AddProductReader) ReadResponse ¶
func (o *AddProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for product management API
func New ¶
func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client
New creates a new product management API client.
func (*Client) AddProduct ¶
func (a *Client) AddProduct(ctx context.Context, params *AddProductParams) (*AddProductCreated, error)
AddProduct inserts a new product in the system
func (*Client) GetProduct ¶
func (a *Client) GetProduct(ctx context.Context, params *GetProductParams) (*GetProductOK, error)
GetProduct returns the information about the product with the given id
func (*Client) ListProducts ¶
func (a *Client) ListProducts(ctx context.Context, params *ListProductsParams) (*ListProductsOK, error)
ListProducts lists all the products in the system
func (*Client) UpdateProduct ¶
func (a *Client) UpdateProduct(ctx context.Context, params *UpdateProductParams) (*UpdateProductOK, error)
UpdateProduct updates the information of the product with the given id
type GetProductInternalServerError ¶
type GetProductInternalServerError struct {
Payload *models.ErrorResponse
}
GetProductInternalServerError handles this case with default header values.
Something unexpected happend, error raised
func NewGetProductInternalServerError ¶
func NewGetProductInternalServerError() *GetProductInternalServerError
NewGetProductInternalServerError creates a GetProductInternalServerError with default headers values
func (*GetProductInternalServerError) Error ¶
func (o *GetProductInternalServerError) Error() string
func (*GetProductInternalServerError) GetPayload ¶
func (o *GetProductInternalServerError) GetPayload() *models.ErrorResponse
type GetProductNotFound ¶
type GetProductNotFound struct {
Payload *models.ErrorResponse
}
GetProductNotFound handles this case with default header values.
The product with the given id wasn't found
func NewGetProductNotFound ¶
func NewGetProductNotFound() *GetProductNotFound
NewGetProductNotFound creates a GetProductNotFound with default headers values
func (*GetProductNotFound) Error ¶
func (o *GetProductNotFound) Error() string
func (*GetProductNotFound) GetPayload ¶
func (o *GetProductNotFound) GetPayload() *models.ErrorResponse
type GetProductOK ¶
GetProductOK handles this case with default header values.
Product with the id given in the system returned
func NewGetProductOK ¶
func NewGetProductOK() *GetProductOK
NewGetProductOK creates a GetProductOK with default headers values
func (*GetProductOK) Error ¶
func (o *GetProductOK) Error() string
func (*GetProductOK) GetPayload ¶
func (o *GetProductOK) GetPayload() *models.Product
type GetProductParams ¶
type GetProductParams struct {
/*ID
Id of the product to be retrieved
*/
ID string
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
GetProductParams contains all the parameters to send to the API endpoint for the get product operation typically these are written to a http.Request
func NewGetProductParams ¶
func NewGetProductParams() *GetProductParams
NewGetProductParams creates a new GetProductParams object with the default values initialized.
func NewGetProductParamsWithContext ¶
func NewGetProductParamsWithContext(ctx context.Context) *GetProductParams
NewGetProductParamsWithContext creates a new GetProductParams object with the default values initialized, and the ability to set a context for a request
func NewGetProductParamsWithHTTPClient ¶
func NewGetProductParamsWithHTTPClient(client *http.Client) *GetProductParams
NewGetProductParamsWithHTTPClient creates a new GetProductParams object with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetProductParamsWithTimeout ¶
func NewGetProductParamsWithTimeout(timeout time.Duration) *GetProductParams
NewGetProductParamsWithTimeout creates a new GetProductParams object with the default values initialized, and the ability to set a timeout on a request
func (*GetProductParams) SetContext ¶
func (o *GetProductParams) SetContext(ctx context.Context)
SetContext adds the context to the get product params
func (*GetProductParams) SetHTTPClient ¶
func (o *GetProductParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the get product params
func (*GetProductParams) SetID ¶
func (o *GetProductParams) SetID(id string)
SetID adds the id to the get product params
func (*GetProductParams) SetTimeout ¶
func (o *GetProductParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the get product params
func (*GetProductParams) WithContext ¶
func (o *GetProductParams) WithContext(ctx context.Context) *GetProductParams
WithContext adds the context to the get product params
func (*GetProductParams) WithHTTPClient ¶
func (o *GetProductParams) WithHTTPClient(client *http.Client) *GetProductParams
WithHTTPClient adds the HTTPClient to the get product params
func (*GetProductParams) WithID ¶
func (o *GetProductParams) WithID(id string) *GetProductParams
WithID adds the id to the get product params
func (*GetProductParams) WithTimeout ¶
func (o *GetProductParams) WithTimeout(timeout time.Duration) *GetProductParams
WithTimeout adds the timeout to the get product params
func (*GetProductParams) WriteToRequest ¶
func (o *GetProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type GetProductReader ¶
type GetProductReader struct {
// contains filtered or unexported fields
}
GetProductReader is a Reader for the GetProduct structure.
func (*GetProductReader) ReadResponse ¶
func (o *GetProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.
type ListProductsInternalServerError ¶
type ListProductsInternalServerError struct {
Payload *models.ErrorResponse
}
ListProductsInternalServerError handles this case with default header values.
Something unexpected happend, error raised
func NewListProductsInternalServerError ¶
func NewListProductsInternalServerError() *ListProductsInternalServerError
NewListProductsInternalServerError creates a ListProductsInternalServerError with default headers values
func (*ListProductsInternalServerError) Error ¶
func (o *ListProductsInternalServerError) Error() string
func (*ListProductsInternalServerError) GetPayload ¶
func (o *ListProductsInternalServerError) GetPayload() *models.ErrorResponse
type ListProductsOK ¶
ListProductsOK handles this case with default header values.
List of products in the system returned
func NewListProductsOK ¶
func NewListProductsOK() *ListProductsOK
NewListProductsOK creates a ListProductsOK with default headers values
func (*ListProductsOK) Error ¶
func (o *ListProductsOK) Error() string
func (*ListProductsOK) GetPayload ¶
func (o *ListProductsOK) GetPayload() []*models.Product
type ListProductsParams ¶
type ListProductsParams struct {
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
ListProductsParams contains all the parameters to send to the API endpoint for the list products operation typically these are written to a http.Request
func NewListProductsParams ¶
func NewListProductsParams() *ListProductsParams
NewListProductsParams creates a new ListProductsParams object with the default values initialized.
func NewListProductsParamsWithContext ¶
func NewListProductsParamsWithContext(ctx context.Context) *ListProductsParams
NewListProductsParamsWithContext creates a new ListProductsParams object with the default values initialized, and the ability to set a context for a request
func NewListProductsParamsWithHTTPClient ¶
func NewListProductsParamsWithHTTPClient(client *http.Client) *ListProductsParams
NewListProductsParamsWithHTTPClient creates a new ListProductsParams object with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewListProductsParamsWithTimeout ¶
func NewListProductsParamsWithTimeout(timeout time.Duration) *ListProductsParams
NewListProductsParamsWithTimeout creates a new ListProductsParams object with the default values initialized, and the ability to set a timeout on a request
func (*ListProductsParams) SetContext ¶
func (o *ListProductsParams) SetContext(ctx context.Context)
SetContext adds the context to the list products params
func (*ListProductsParams) SetHTTPClient ¶
func (o *ListProductsParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the list products params
func (*ListProductsParams) SetTimeout ¶
func (o *ListProductsParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the list products params
func (*ListProductsParams) WithContext ¶
func (o *ListProductsParams) WithContext(ctx context.Context) *ListProductsParams
WithContext adds the context to the list products params
func (*ListProductsParams) WithHTTPClient ¶
func (o *ListProductsParams) WithHTTPClient(client *http.Client) *ListProductsParams
WithHTTPClient adds the HTTPClient to the list products params
func (*ListProductsParams) WithTimeout ¶
func (o *ListProductsParams) WithTimeout(timeout time.Duration) *ListProductsParams
WithTimeout adds the timeout to the list products params
func (*ListProductsParams) WriteToRequest ¶
func (o *ListProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type ListProductsReader ¶
type ListProductsReader struct {
// contains filtered or unexported fields
}
ListProductsReader is a Reader for the ListProducts structure.
func (*ListProductsReader) ReadResponse ¶
func (o *ListProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.
type UpdateProductInternalServerError ¶
type UpdateProductInternalServerError struct {
Payload *models.ErrorResponse
}
UpdateProductInternalServerError handles this case with default header values.
Something unexpected happend, error raised
func NewUpdateProductInternalServerError ¶
func NewUpdateProductInternalServerError() *UpdateProductInternalServerError
NewUpdateProductInternalServerError creates a UpdateProductInternalServerError with default headers values
func (*UpdateProductInternalServerError) Error ¶
func (o *UpdateProductInternalServerError) Error() string
func (*UpdateProductInternalServerError) GetPayload ¶
func (o *UpdateProductInternalServerError) GetPayload() *models.ErrorResponse
type UpdateProductNotFound ¶
type UpdateProductNotFound struct {
Payload *models.ErrorResponse
}
UpdateProductNotFound handles this case with default header values.
The product with the given id wasn't found
func NewUpdateProductNotFound ¶
func NewUpdateProductNotFound() *UpdateProductNotFound
NewUpdateProductNotFound creates a UpdateProductNotFound with default headers values
func (*UpdateProductNotFound) Error ¶
func (o *UpdateProductNotFound) Error() string
func (*UpdateProductNotFound) GetPayload ¶
func (o *UpdateProductNotFound) GetPayload() *models.ErrorResponse
type UpdateProductOK ¶
type UpdateProductOK struct {
Payload *models.ItemCreatedResponse
}
UpdateProductOK handles this case with default header values.
Product with the given id was updated
func NewUpdateProductOK ¶
func NewUpdateProductOK() *UpdateProductOK
NewUpdateProductOK creates a UpdateProductOK with default headers values
func (*UpdateProductOK) Error ¶
func (o *UpdateProductOK) Error() string
func (*UpdateProductOK) GetPayload ¶
func (o *UpdateProductOK) GetPayload() *models.ItemCreatedResponse
type UpdateProductParams ¶
type UpdateProductParams struct {
/*ID
Id of the product to be updated
*/
ID string
/*Product
Product to be updated
*/
Product *models.Product
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
UpdateProductParams contains all the parameters to send to the API endpoint for the update product operation typically these are written to a http.Request
func NewUpdateProductParams ¶
func NewUpdateProductParams() *UpdateProductParams
NewUpdateProductParams creates a new UpdateProductParams object with the default values initialized.
func NewUpdateProductParamsWithContext ¶
func NewUpdateProductParamsWithContext(ctx context.Context) *UpdateProductParams
NewUpdateProductParamsWithContext creates a new UpdateProductParams object with the default values initialized, and the ability to set a context for a request
func NewUpdateProductParamsWithHTTPClient ¶
func NewUpdateProductParamsWithHTTPClient(client *http.Client) *UpdateProductParams
NewUpdateProductParamsWithHTTPClient creates a new UpdateProductParams object with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewUpdateProductParamsWithTimeout ¶
func NewUpdateProductParamsWithTimeout(timeout time.Duration) *UpdateProductParams
NewUpdateProductParamsWithTimeout creates a new UpdateProductParams object with the default values initialized, and the ability to set a timeout on a request
func (*UpdateProductParams) SetContext ¶
func (o *UpdateProductParams) SetContext(ctx context.Context)
SetContext adds the context to the update product params
func (*UpdateProductParams) SetHTTPClient ¶
func (o *UpdateProductParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the update product params
func (*UpdateProductParams) SetID ¶
func (o *UpdateProductParams) SetID(id string)
SetID adds the id to the update product params
func (*UpdateProductParams) SetProduct ¶
func (o *UpdateProductParams) SetProduct(product *models.Product)
SetProduct adds the product to the update product params
func (*UpdateProductParams) SetTimeout ¶
func (o *UpdateProductParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the update product params
func (*UpdateProductParams) WithContext ¶
func (o *UpdateProductParams) WithContext(ctx context.Context) *UpdateProductParams
WithContext adds the context to the update product params
func (*UpdateProductParams) WithHTTPClient ¶
func (o *UpdateProductParams) WithHTTPClient(client *http.Client) *UpdateProductParams
WithHTTPClient adds the HTTPClient to the update product params
func (*UpdateProductParams) WithID ¶
func (o *UpdateProductParams) WithID(id string) *UpdateProductParams
WithID adds the id to the update product params
func (*UpdateProductParams) WithProduct ¶
func (o *UpdateProductParams) WithProduct(product *models.Product) *UpdateProductParams
WithProduct adds the product to the update product params
func (*UpdateProductParams) WithTimeout ¶
func (o *UpdateProductParams) WithTimeout(timeout time.Duration) *UpdateProductParams
WithTimeout adds the timeout to the update product params
func (*UpdateProductParams) WriteToRequest ¶
func (o *UpdateProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type UpdateProductReader ¶
type UpdateProductReader struct {
// contains filtered or unexported fields
}
UpdateProductReader is a Reader for the UpdateProduct structure.
func (*UpdateProductReader) ReadResponse ¶
func (o *UpdateProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.