creditclient

package
v0.0.0-...-c41c7e3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package creditclient provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Package creditclient provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(server string, body CreateJSONRequestBody) (*http.Request, error)

NewCreateRequest calls the generic Create builder with application/json body

func NewCreateRequestWithBody

func NewCreateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRequestWithBody generates requests for Create with any type of body

func NewDeleteRequest

func NewDeleteRequest(server string, acceptNo string) (*http.Request, error)

NewDeleteRequest generates requests for Delete

func NewGetByAcceptNoRequest

func NewGetByAcceptNoRequest(server string, acceptNo string) (*http.Request, error)

NewGetByAcceptNoRequest generates requests for GetByAcceptNo

func NewHealthzRequest

func NewHealthzRequest(server string) (*http.Request, error)

NewHealthzRequest generates requests for Healthz

func NewUpdateRequest

func NewUpdateRequest(server string, body UpdateJSONRequestBody) (*http.Request, error)

NewUpdateRequest calls the generic Update builder with application/json body

func NewUpdateRequestWithBody

func NewUpdateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRequestWithBody generates requests for Update with any type of body

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) Create

func (c *Client) Create(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateWithBody

func (c *Client) CreateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetByAcceptNo

func (c *Client) GetByAcceptNo(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Healthz

func (c *Client) Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateWithBody

func (c *Client) UpdateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Create request with any body
	CreateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Create(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Update request with any body
	UpdateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Update(ctx context.Context, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Delete request
	Delete(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetByAcceptNo request
	GetByAcceptNo(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Healthz request
	Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateWithBodyWithResponse

func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithBodyWithResponse request with arbitrary body returning *CreateResponse

func (*ClientWithResponses) CreateWithResponse

func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

func (*ClientWithResponses) DeleteWithResponse

func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

DeleteWithResponse request returning *DeleteResponse

func (*ClientWithResponses) GetByAcceptNoWithResponse

func (c *ClientWithResponses) GetByAcceptNoWithResponse(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*GetByAcceptNoResponse, error)

GetByAcceptNoWithResponse request returning *GetByAcceptNoResponse

func (*ClientWithResponses) HealthzWithResponse

func (c *ClientWithResponses) HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error)

HealthzWithResponse request returning *HealthzResponse

func (*ClientWithResponses) UpdateWithBodyWithResponse

func (c *ClientWithResponses) UpdateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

UpdateWithBodyWithResponse request with arbitrary body returning *UpdateResponse

func (*ClientWithResponses) UpdateWithResponse

func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Create request with any body
	CreateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	CreateWithResponse(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	// Update request with any body
	UpdateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	UpdateWithResponse(ctx context.Context, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	// Delete request
	DeleteWithResponse(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

	// GetByAcceptNo request
	GetByAcceptNoWithResponse(ctx context.Context, acceptNo string, reqEditors ...RequestEditorFn) (*GetByAcceptNoResponse, error)

	// Healthz request
	HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateJSONBody

type CreateJSONBody RestCreateCreditPayment

CreateJSONBody defines parameters for Create.

type CreateJSONRequestBody

type CreateJSONRequestBody CreateJSONBody

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RestCreditPayment
}

func ParseCreateResponse

func ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)

ParseCreateResponse parses an HTTP response from a CreateWithResponse call

func (CreateResponse) Status

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteResponse

type DeleteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteResponse

func ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)

ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call

func (DeleteResponse) Status

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetByAcceptNoResponse

type GetByAcceptNoResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RestCreditPayment
}

func ParseGetByAcceptNoResponse

func ParseGetByAcceptNoResponse(rsp *http.Response) (*GetByAcceptNoResponse, error)

ParseGetByAcceptNoResponse parses an HTTP response from a GetByAcceptNoWithResponse call

func (GetByAcceptNoResponse) Status

func (r GetByAcceptNoResponse) Status() string

Status returns HTTPResponse.Status

func (GetByAcceptNoResponse) StatusCode

func (r GetByAcceptNoResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HealthzResponse

type HealthzResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseHealthzResponse

func ParseHealthzResponse(rsp *http.Response) (*HealthzResponse, error)

ParseHealthzResponse parses an HTTP response from a HealthzWithResponse call

func (HealthzResponse) Status

func (r HealthzResponse) Status() string

Status returns HTTPResponse.Status

func (HealthzResponse) StatusCode

func (r HealthzResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RestCreateCreditPayment

type RestCreateCreditPayment struct {
	CustomerId int32  `json:"customerId"`
	OrderDate  string `json:"orderDate"`
	OrderNo    string `json:"orderNo"`
	TotalPrice int32  `json:"totalPrice"`
}

RestCreateCreditPayment defines model for RestCreateCreditPayment.

type RestCreditPayment

type RestCreditPayment struct {
	AcceptDate *string `json:"acceptDate,omitempty"`
	AcceptNo   *string `json:"acceptNo,omitempty"`
	CustomerId *int32  `json:"customerId,omitempty"`
	OrderDate  *string `json:"orderDate,omitempty"`
	OrderNo    *string `json:"orderNo,omitempty"`
	TotalPrice *int32  `json:"totalPrice,omitempty"`
}

RestCreditPayment defines model for RestCreditPayment.

type RestUpdateCreditPayment

type RestUpdateCreditPayment struct {
	AcceptDate *string `json:"acceptDate,omitempty"`
	AcceptNo   string  `json:"acceptNo"`
	CustomerId *int32  `json:"customerId,omitempty"`
	OrderDate  *string `json:"orderDate,omitempty"`
	OrderNo    *string `json:"orderNo,omitempty"`
	TotalPrice *int32  `json:"totalPrice,omitempty"`
}

RestUpdateCreditPayment defines model for RestUpdateCreditPayment.

type UpdateJSONBody

type UpdateJSONBody RestUpdateCreditPayment

UpdateJSONBody defines parameters for Update.

type UpdateJSONRequestBody

type UpdateJSONRequestBody UpdateJSONBody

UpdateJSONRequestBody defines body for Update for application/json ContentType.

type UpdateResponse

type UpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RestCreditPayment
}

func ParseUpdateResponse

func ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)

ParseUpdateResponse parses an HTTP response from a UpdateWithResponse call

func (UpdateResponse) Status

func (r UpdateResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateResponse) StatusCode

func (r UpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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