aznum2wordsclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewConvertNumberToWordRequest

func NewConvertNumberToWordRequest(server string, params *ConvertNumberToWordParams, body ConvertNumberToWordJSONRequestBody) (*http.Request, error)

NewConvertNumberToWordRequest calls the generic ConvertNumberToWord builder with application/json body

func NewConvertNumberToWordRequestWithBody

func NewConvertNumberToWordRequestWithBody(server string, params *ConvertNumberToWordParams, contentType string, body io.Reader) (*http.Request, error)

NewConvertNumberToWordRequestWithBody generates requests for ConvertNumberToWord with any type of body

func NewConvertWordsToNumberRequest

func NewConvertWordsToNumberRequest(server string, params *ConvertWordsToNumberParams, body ConvertWordsToNumberJSONRequestBody) (*http.Request, error)

NewConvertWordsToNumberRequest calls the generic ConvertWordsToNumber builder with application/json body

func NewConvertWordsToNumberRequestWithBody

func NewConvertWordsToNumberRequestWithBody(server string, params *ConvertWordsToNumberParams, contentType string, body io.Reader) (*http.Request, error)

NewConvertWordsToNumberRequestWithBody generates requests for ConvertWordsToNumber with any type of body

func NewGetHealthRequest

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

NewGetHealthRequest generates requests for GetHealth

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type AzNum2WordsClient

type AzNum2WordsClient 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
}

AzNum2WordsClient which conforms to the OpenAPI3 specification for this service.

func NewClient

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

Creates a new AzNum2WordsClient, with reasonable defaults

func (*AzNum2WordsClient) ConvertNumberToWord

func (*AzNum2WordsClient) ConvertNumberToWordWithBody

func (c *AzNum2WordsClient) ConvertNumberToWordWithBody(ctx context.Context, params *ConvertNumberToWordParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*AzNum2WordsClient) ConvertWordsToNumber

func (*AzNum2WordsClient) ConvertWordsToNumberWithBody

func (c *AzNum2WordsClient) ConvertWordsToNumberWithBody(ctx context.Context, params *ConvertWordsToNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*AzNum2WordsClient) GetHealth

func (c *AzNum2WordsClient) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

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

	ConvertWordsToNumber(ctx context.Context, params *ConvertWordsToNumberParams, body ConvertWordsToNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ConvertNumberToWord request with any body
	ConvertNumberToWordWithBody(ctx context.Context, params *ConvertNumberToWordParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ConvertNumberToWord(ctx context.Context, params *ConvertNumberToWordParams, body ConvertNumberToWordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

The interface specification for the client above.

type ClientOption

type ClientOption func(*AzNum2WordsClient) 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) ConvertNumberToWordWithBodyWithResponse

func (c *ClientWithResponses) ConvertNumberToWordWithBodyWithResponse(ctx context.Context, params *ConvertNumberToWordParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConvertNumberToWordResponse, error)

ConvertNumberToWordWithBodyWithResponse request with arbitrary body returning *ConvertNumberToWordResponse

func (*ClientWithResponses) ConvertNumberToWordWithResponse

func (*ClientWithResponses) ConvertWordsToNumberWithBodyWithResponse

func (c *ClientWithResponses) ConvertWordsToNumberWithBodyWithResponse(ctx context.Context, params *ConvertWordsToNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConvertWordsToNumberResponse, error)

ConvertWordsToNumberWithBodyWithResponse request with arbitrary body returning *ConvertWordsToNumberResponse

func (*ClientWithResponses) ConvertWordsToNumberWithResponse

func (*ClientWithResponses) GetHealthWithResponse

func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

GetHealthWithResponse request returning *GetHealthResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ConvertWordsToNumber request with any body
	ConvertWordsToNumberWithBodyWithResponse(ctx context.Context, params *ConvertWordsToNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConvertWordsToNumberResponse, error)

	ConvertWordsToNumberWithResponse(ctx context.Context, params *ConvertWordsToNumberParams, body ConvertWordsToNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*ConvertWordsToNumberResponse, error)

	// ConvertNumberToWord request with any body
	ConvertNumberToWordWithBodyWithResponse(ctx context.Context, params *ConvertNumberToWordParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConvertNumberToWordResponse, error)

	ConvertNumberToWordWithResponse(ctx context.Context, params *ConvertNumberToWordParams, body ConvertNumberToWordJSONRequestBody, reqEditors ...RequestEditorFn) (*ConvertNumberToWordResponse, error)

	// GetHealth request
	GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
}

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

type ConvertNumberToWordJSONRequestBody

type ConvertNumberToWordJSONRequestBody = ConvertNumberToWords

ConvertNumberToWordJSONRequestBody defines body for ConvertNumberToWord for application/json ContentType.

type ConvertNumberToWordParams

type ConvertNumberToWordParams struct {
	// XCorrelationId The unique request identifier
	XCorrelationId *XCorrelationId `json:"x-correlation-id,omitempty"`
}

ConvertNumberToWordParams defines parameters for ConvertNumberToWord.

type ConvertNumberToWordResponse

type ConvertNumberToWordResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Word
	JSONDefault  *Error
}

func ParseConvertNumberToWordResponse

func ParseConvertNumberToWordResponse(rsp *http.Response) (*ConvertNumberToWordResponse, error)

ParseConvertNumberToWordResponse parses an HTTP response from a ConvertNumberToWordWithResponse call

func (ConvertNumberToWordResponse) Status

Status returns HTTPResponse.Status

func (ConvertNumberToWordResponse) StatusCode

func (r ConvertNumberToWordResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ConvertNumberToWords

type ConvertNumberToWords struct {
	// Number The number to be converted to words
	Number string `json:"number"`
}

ConvertNumberToWords Convert number to words request representation

type ConvertNumberToWordsRequest

type ConvertNumberToWordsRequest = ConvertNumberToWords

ConvertNumberToWordsRequest Convert number to words request representation

type ConvertWordsToNumber

type ConvertWordsToNumber struct {
	// Words The words to be converted to number
	Words string `json:"words"`
}

ConvertWordsToNumber Convert words to number request representation

type ConvertWordsToNumberJSONRequestBody

type ConvertWordsToNumberJSONRequestBody = ConvertWordsToNumber

ConvertWordsToNumberJSONRequestBody defines body for ConvertWordsToNumber for application/json ContentType.

type ConvertWordsToNumberParams

type ConvertWordsToNumberParams struct {
	// XCorrelationId The unique request identifier
	XCorrelationId *XCorrelationId `json:"x-correlation-id,omitempty"`
}

ConvertWordsToNumberParams defines parameters for ConvertWordsToNumber.

type ConvertWordsToNumberRequest

type ConvertWordsToNumberRequest = ConvertWordsToNumber

ConvertWordsToNumberRequest Convert words to number request representation

type ConvertWordsToNumberResponse

type ConvertWordsToNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Number
	JSONDefault  *Error
}

func ParseConvertWordsToNumberResponse

func ParseConvertWordsToNumberResponse(rsp *http.Response) (*ConvertWordsToNumberResponse, error)

ParseConvertWordsToNumberResponse parses an HTTP response from a ConvertWordsToNumberWithResponse call

func (ConvertWordsToNumberResponse) Status

Status returns HTTPResponse.Status

func (ConvertWordsToNumberResponse) StatusCode

func (r ConvertWordsToNumberResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	// Code The code of an error that describes the Error.
	Code string `json:"code"`

	// Message The message of an error that describes the Error.
	Message string `json:"message"`
}

Error Representation of an Error that can appear using the application.

type GetHealthResponse

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

func ParseGetHealthResponse

func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error)

ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call

func (GetHealthResponse) Status

func (r GetHealthResponse) Status() string

Status returns HTTPResponse.Status

func (GetHealthResponse) StatusCode

func (r GetHealthResponse) 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 Number

type Number struct {
	// Number Words representation in number
	Number string `json:"number"`
}

Number Words representation in number

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type UnknownError

type UnknownError = Error

UnknownError Representation of an Error that can appear using the application.

type Word

type Word struct {
	// Words The number representation in words
	Words string `json:"words"`
}

Word The number representation in words

type XCorrelationId

type XCorrelationId = string

XCorrelationId defines model for x-correlation-id.

Jump to

Keyboard shortcuts

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