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

customer_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 {
	/*
	   AddCustomer inserts a new customer in the system*/
	AddCustomer(ctx context.Context, params *AddCustomerParams) (*AddCustomerCreated, *AddCustomerAccepted, error)
	/*
	   GetCustomer returns the information about the customer with the given id*/
	GetCustomer(ctx context.Context, params *GetCustomerParams) (*GetCustomerOK, error)
	/*
	   ListCustomers lists all the customers in the system*/
	ListCustomers(ctx context.Context, params *ListCustomersParams) (*ListCustomersOK, error)
	/*
	   UpdateCustomer updates the information of the customer with the given id*/
	UpdateCustomer(ctx context.Context, params *UpdateCustomerParams) (*UpdateCustomerOK, *UpdateCustomerAccepted, error)
}

API is the interface of the customer management client

type AddCustomerAccepted

type AddCustomerAccepted struct {
	Payload *models.ItemCreatedResponse
}

AddCustomerAccepted handles this case with default header values.

The new customer was added but there might have been some fails when adding part of the data

func NewAddCustomerAccepted

func NewAddCustomerAccepted() *AddCustomerAccepted

NewAddCustomerAccepted creates a AddCustomerAccepted with default headers values

func (*AddCustomerAccepted) Error

func (o *AddCustomerAccepted) Error() string

func (*AddCustomerAccepted) GetPayload

type AddCustomerBadRequest

type AddCustomerBadRequest struct {
}

AddCustomerBadRequest handles this case with default header values.

Invalid input, object invalid

func NewAddCustomerBadRequest

func NewAddCustomerBadRequest() *AddCustomerBadRequest

NewAddCustomerBadRequest creates a AddCustomerBadRequest with default headers values

func (*AddCustomerBadRequest) Error

func (o *AddCustomerBadRequest) Error() string

type AddCustomerConflict

type AddCustomerConflict struct {
	Payload *models.ErrorResponse
}

AddCustomerConflict handles this case with default header values.

The given item already exists

func NewAddCustomerConflict

func NewAddCustomerConflict() *AddCustomerConflict

NewAddCustomerConflict creates a AddCustomerConflict with default headers values

func (*AddCustomerConflict) Error

func (o *AddCustomerConflict) Error() string

func (*AddCustomerConflict) GetPayload

func (o *AddCustomerConflict) GetPayload() *models.ErrorResponse

type AddCustomerCreated

type AddCustomerCreated struct {
	Payload *models.ItemCreatedResponse
}

AddCustomerCreated handles this case with default header values.

New customer was added successfully

func NewAddCustomerCreated

func NewAddCustomerCreated() *AddCustomerCreated

NewAddCustomerCreated creates a AddCustomerCreated with default headers values

func (*AddCustomerCreated) Error

func (o *AddCustomerCreated) Error() string

func (*AddCustomerCreated) GetPayload

type AddCustomerInternalServerError

type AddCustomerInternalServerError struct {
	Payload *models.ErrorResponse
}

AddCustomerInternalServerError handles this case with default header values.

Something unexpected happend, error raised

func NewAddCustomerInternalServerError

func NewAddCustomerInternalServerError() *AddCustomerInternalServerError

NewAddCustomerInternalServerError creates a AddCustomerInternalServerError with default headers values

func (*AddCustomerInternalServerError) Error

func (*AddCustomerInternalServerError) GetPayload

type AddCustomerParams

type AddCustomerParams struct {

	/*Customer
	  Customer to be added

	*/
	Customer *models.Customer

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

AddCustomerParams contains all the parameters to send to the API endpoint for the add customer operation typically these are written to a http.Request

func NewAddCustomerParams

func NewAddCustomerParams() *AddCustomerParams

NewAddCustomerParams creates a new AddCustomerParams object with the default values initialized.

func NewAddCustomerParamsWithContext

func NewAddCustomerParamsWithContext(ctx context.Context) *AddCustomerParams

NewAddCustomerParamsWithContext creates a new AddCustomerParams object with the default values initialized, and the ability to set a context for a request

func NewAddCustomerParamsWithHTTPClient

func NewAddCustomerParamsWithHTTPClient(client *http.Client) *AddCustomerParams

NewAddCustomerParamsWithHTTPClient creates a new AddCustomerParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewAddCustomerParamsWithTimeout

func NewAddCustomerParamsWithTimeout(timeout time.Duration) *AddCustomerParams

NewAddCustomerParamsWithTimeout creates a new AddCustomerParams object with the default values initialized, and the ability to set a timeout on a request

func (*AddCustomerParams) SetContext

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

SetContext adds the context to the add customer params

func (*AddCustomerParams) SetCustomer

func (o *AddCustomerParams) SetCustomer(customer *models.Customer)

SetCustomer adds the customer to the add customer params

func (*AddCustomerParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the add customer params

func (*AddCustomerParams) SetTimeout

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

SetTimeout adds the timeout to the add customer params

func (*AddCustomerParams) WithContext

func (o *AddCustomerParams) WithContext(ctx context.Context) *AddCustomerParams

WithContext adds the context to the add customer params

func (*AddCustomerParams) WithCustomer

func (o *AddCustomerParams) WithCustomer(customer *models.Customer) *AddCustomerParams

WithCustomer adds the customer to the add customer params

func (*AddCustomerParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the add customer params

func (*AddCustomerParams) WithTimeout

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

WithTimeout adds the timeout to the add customer params

func (*AddCustomerParams) WriteToRequest

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

WriteToRequest writes these params to a swagger request

type AddCustomerReader

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

AddCustomerReader is a Reader for the AddCustomer structure.

func (*AddCustomerReader) ReadResponse

func (o *AddCustomerReader) 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 customer management API

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client

New creates a new customer management API client.

func (*Client) AddCustomer

AddCustomer inserts a new customer in the system

func (*Client) GetCustomer

func (a *Client) GetCustomer(ctx context.Context, params *GetCustomerParams) (*GetCustomerOK, error)

GetCustomer returns the information about the customer with the given id

func (*Client) ListCustomers

func (a *Client) ListCustomers(ctx context.Context, params *ListCustomersParams) (*ListCustomersOK, error)

ListCustomers lists all the customers in the system

func (*Client) UpdateCustomer

UpdateCustomer updates the information of the customer with the given id

type GetCustomerInternalServerError

type GetCustomerInternalServerError struct {
	Payload *models.ErrorResponse
}

GetCustomerInternalServerError handles this case with default header values.

Something unexpected happend, error raised

func NewGetCustomerInternalServerError

func NewGetCustomerInternalServerError() *GetCustomerInternalServerError

NewGetCustomerInternalServerError creates a GetCustomerInternalServerError with default headers values

func (*GetCustomerInternalServerError) Error

func (*GetCustomerInternalServerError) GetPayload

type GetCustomerNotFound

type GetCustomerNotFound struct {
	Payload *models.ErrorResponse
}

GetCustomerNotFound handles this case with default header values.

The customer with the given id wasn't found

func NewGetCustomerNotFound

func NewGetCustomerNotFound() *GetCustomerNotFound

NewGetCustomerNotFound creates a GetCustomerNotFound with default headers values

func (*GetCustomerNotFound) Error

func (o *GetCustomerNotFound) Error() string

func (*GetCustomerNotFound) GetPayload

func (o *GetCustomerNotFound) GetPayload() *models.ErrorResponse

type GetCustomerOK

type GetCustomerOK struct {
	Payload *models.Customer
}

GetCustomerOK handles this case with default header values.

Customer with the id given in the system returned

func NewGetCustomerOK

func NewGetCustomerOK() *GetCustomerOK

NewGetCustomerOK creates a GetCustomerOK with default headers values

func (*GetCustomerOK) Error

func (o *GetCustomerOK) Error() string

func (*GetCustomerOK) GetPayload

func (o *GetCustomerOK) GetPayload() *models.Customer

type GetCustomerParams

type GetCustomerParams struct {

	/*ID
	  Id of the customer to be retrieved

	*/
	ID string

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

GetCustomerParams contains all the parameters to send to the API endpoint for the get customer operation typically these are written to a http.Request

func NewGetCustomerParams

func NewGetCustomerParams() *GetCustomerParams

NewGetCustomerParams creates a new GetCustomerParams object with the default values initialized.

func NewGetCustomerParamsWithContext

func NewGetCustomerParamsWithContext(ctx context.Context) *GetCustomerParams

NewGetCustomerParamsWithContext creates a new GetCustomerParams object with the default values initialized, and the ability to set a context for a request

func NewGetCustomerParamsWithHTTPClient

func NewGetCustomerParamsWithHTTPClient(client *http.Client) *GetCustomerParams

NewGetCustomerParamsWithHTTPClient creates a new GetCustomerParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewGetCustomerParamsWithTimeout

func NewGetCustomerParamsWithTimeout(timeout time.Duration) *GetCustomerParams

NewGetCustomerParamsWithTimeout creates a new GetCustomerParams object with the default values initialized, and the ability to set a timeout on a request

func (*GetCustomerParams) SetContext

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

SetContext adds the context to the get customer params

func (*GetCustomerParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the get customer params

func (*GetCustomerParams) SetID

func (o *GetCustomerParams) SetID(id string)

SetID adds the id to the get customer params

func (*GetCustomerParams) SetTimeout

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

SetTimeout adds the timeout to the get customer params

func (*GetCustomerParams) WithContext

func (o *GetCustomerParams) WithContext(ctx context.Context) *GetCustomerParams

WithContext adds the context to the get customer params

func (*GetCustomerParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the get customer params

func (*GetCustomerParams) WithID

WithID adds the id to the get customer params

func (*GetCustomerParams) WithTimeout

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

WithTimeout adds the timeout to the get customer params

func (*GetCustomerParams) WriteToRequest

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

WriteToRequest writes these params to a swagger request

type GetCustomerReader

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

GetCustomerReader is a Reader for the GetCustomer structure.

func (*GetCustomerReader) ReadResponse

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

ReadResponse reads a server response into the received o.

type ListCustomersInternalServerError

type ListCustomersInternalServerError struct {
	Payload *models.ErrorResponse
}

ListCustomersInternalServerError handles this case with default header values.

Something unexpected happend, error raised

func NewListCustomersInternalServerError

func NewListCustomersInternalServerError() *ListCustomersInternalServerError

NewListCustomersInternalServerError creates a ListCustomersInternalServerError with default headers values

func (*ListCustomersInternalServerError) Error

func (*ListCustomersInternalServerError) GetPayload

type ListCustomersOK

type ListCustomersOK struct {
	Payload []*models.Customer
}

ListCustomersOK handles this case with default header values.

List of customers in the system returned

func NewListCustomersOK

func NewListCustomersOK() *ListCustomersOK

NewListCustomersOK creates a ListCustomersOK with default headers values

func (*ListCustomersOK) Error

func (o *ListCustomersOK) Error() string

func (*ListCustomersOK) GetPayload

func (o *ListCustomersOK) GetPayload() []*models.Customer

type ListCustomersParams

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

ListCustomersParams contains all the parameters to send to the API endpoint for the list customers operation typically these are written to a http.Request

func NewListCustomersParams

func NewListCustomersParams() *ListCustomersParams

NewListCustomersParams creates a new ListCustomersParams object with the default values initialized.

func NewListCustomersParamsWithContext

func NewListCustomersParamsWithContext(ctx context.Context) *ListCustomersParams

NewListCustomersParamsWithContext creates a new ListCustomersParams object with the default values initialized, and the ability to set a context for a request

func NewListCustomersParamsWithHTTPClient

func NewListCustomersParamsWithHTTPClient(client *http.Client) *ListCustomersParams

NewListCustomersParamsWithHTTPClient creates a new ListCustomersParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewListCustomersParamsWithTimeout

func NewListCustomersParamsWithTimeout(timeout time.Duration) *ListCustomersParams

NewListCustomersParamsWithTimeout creates a new ListCustomersParams object with the default values initialized, and the ability to set a timeout on a request

func (*ListCustomersParams) SetContext

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

SetContext adds the context to the list customers params

func (*ListCustomersParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the list customers params

func (*ListCustomersParams) SetTimeout

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

SetTimeout adds the timeout to the list customers params

func (*ListCustomersParams) WithContext

WithContext adds the context to the list customers params

func (*ListCustomersParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the list customers params

func (*ListCustomersParams) WithTimeout

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

WithTimeout adds the timeout to the list customers params

func (*ListCustomersParams) WriteToRequest

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

WriteToRequest writes these params to a swagger request

type ListCustomersReader

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

ListCustomersReader is a Reader for the ListCustomers structure.

func (*ListCustomersReader) ReadResponse

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

ReadResponse reads a server response into the received o.

type UpdateCustomerAccepted

type UpdateCustomerAccepted struct {
	Payload *models.ItemCreatedResponse
}

UpdateCustomerAccepted handles this case with default header values.

The customer was updated but there might have been some fails when adding part of the data

func NewUpdateCustomerAccepted

func NewUpdateCustomerAccepted() *UpdateCustomerAccepted

NewUpdateCustomerAccepted creates a UpdateCustomerAccepted with default headers values

func (*UpdateCustomerAccepted) Error

func (o *UpdateCustomerAccepted) Error() string

func (*UpdateCustomerAccepted) GetPayload

type UpdateCustomerInternalServerError

type UpdateCustomerInternalServerError struct {
	Payload *models.ErrorResponse
}

UpdateCustomerInternalServerError handles this case with default header values.

Something unexpected happend, error raised

func NewUpdateCustomerInternalServerError

func NewUpdateCustomerInternalServerError() *UpdateCustomerInternalServerError

NewUpdateCustomerInternalServerError creates a UpdateCustomerInternalServerError with default headers values

func (*UpdateCustomerInternalServerError) Error

func (*UpdateCustomerInternalServerError) GetPayload

type UpdateCustomerNotFound

type UpdateCustomerNotFound struct {
	Payload *models.ErrorResponse
}

UpdateCustomerNotFound handles this case with default header values.

The customer with the given id wasn't found

func NewUpdateCustomerNotFound

func NewUpdateCustomerNotFound() *UpdateCustomerNotFound

NewUpdateCustomerNotFound creates a UpdateCustomerNotFound with default headers values

func (*UpdateCustomerNotFound) Error

func (o *UpdateCustomerNotFound) Error() string

func (*UpdateCustomerNotFound) GetPayload

func (o *UpdateCustomerNotFound) GetPayload() *models.ErrorResponse

type UpdateCustomerOK

type UpdateCustomerOK struct {
	Payload *models.ItemCreatedResponse
}

UpdateCustomerOK handles this case with default header values.

Customer with the given id was updated

func NewUpdateCustomerOK

func NewUpdateCustomerOK() *UpdateCustomerOK

NewUpdateCustomerOK creates a UpdateCustomerOK with default headers values

func (*UpdateCustomerOK) Error

func (o *UpdateCustomerOK) Error() string

func (*UpdateCustomerOK) GetPayload

func (o *UpdateCustomerOK) GetPayload() *models.ItemCreatedResponse

type UpdateCustomerParams

type UpdateCustomerParams struct {

	/*Customer
	  Customer to be updated

	*/
	Customer *models.Customer
	/*ID
	  Id of the customer to be updated

	*/
	ID string

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

UpdateCustomerParams contains all the parameters to send to the API endpoint for the update customer operation typically these are written to a http.Request

func NewUpdateCustomerParams

func NewUpdateCustomerParams() *UpdateCustomerParams

NewUpdateCustomerParams creates a new UpdateCustomerParams object with the default values initialized.

func NewUpdateCustomerParamsWithContext

func NewUpdateCustomerParamsWithContext(ctx context.Context) *UpdateCustomerParams

NewUpdateCustomerParamsWithContext creates a new UpdateCustomerParams object with the default values initialized, and the ability to set a context for a request

func NewUpdateCustomerParamsWithHTTPClient

func NewUpdateCustomerParamsWithHTTPClient(client *http.Client) *UpdateCustomerParams

NewUpdateCustomerParamsWithHTTPClient creates a new UpdateCustomerParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewUpdateCustomerParamsWithTimeout

func NewUpdateCustomerParamsWithTimeout(timeout time.Duration) *UpdateCustomerParams

NewUpdateCustomerParamsWithTimeout creates a new UpdateCustomerParams object with the default values initialized, and the ability to set a timeout on a request

func (*UpdateCustomerParams) SetContext

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

SetContext adds the context to the update customer params

func (*UpdateCustomerParams) SetCustomer

func (o *UpdateCustomerParams) SetCustomer(customer *models.Customer)

SetCustomer adds the customer to the update customer params

func (*UpdateCustomerParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the update customer params

func (*UpdateCustomerParams) SetID

func (o *UpdateCustomerParams) SetID(id string)

SetID adds the id to the update customer params

func (*UpdateCustomerParams) SetTimeout

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

SetTimeout adds the timeout to the update customer params

func (*UpdateCustomerParams) WithContext

WithContext adds the context to the update customer params

func (*UpdateCustomerParams) WithCustomer

func (o *UpdateCustomerParams) WithCustomer(customer *models.Customer) *UpdateCustomerParams

WithCustomer adds the customer to the update customer params

func (*UpdateCustomerParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the update customer params

func (*UpdateCustomerParams) WithID

WithID adds the id to the update customer params

func (*UpdateCustomerParams) WithTimeout

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

WithTimeout adds the timeout to the update customer params

func (*UpdateCustomerParams) WriteToRequest

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

WriteToRequest writes these params to a swagger request

type UpdateCustomerReader

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

UpdateCustomerReader is a Reader for the UpdateCustomer structure.

func (*UpdateCustomerReader) ReadResponse

func (o *UpdateCustomerReader) 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