product_management package - github.com/GoDieNow/TFT_Code/services/customerdb/client/product_management - Go Packages

product_management

package
v0.0.0-...-33e56a9 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

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 (*AddProductInternalServerError) GetPayload

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 (*GetProductInternalServerError) GetPayload

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

type GetProductOK struct {
	Payload *models.Product
}

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 (*ListProductsInternalServerError) GetPayload

type ListProductsOK

type ListProductsOK struct {
	Payload []*models.Product
}

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

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 (*UpdateProductInternalServerError) GetPayload

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

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

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.

Jump to

Keyboard shortcuts

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