operations

package
v2.1.14 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Code generated by github.com/KosyanMedia/oapi-codegen/v2 version (devel) DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLeavePostOnlyPostRequest

func NewLeavePostOnlyPostRequest(server string, params LeavePostOnlyPostParams) (*http.Request, error)

NewLeavePostOnlyPostRequest generates requests for LeavePostOnlyPost

func NewShouldHaveBothRequest

func NewShouldHaveBothRequest(server string, params ShouldHaveBothParams) (*http.Request, error)

NewShouldHaveBothRequest generates requests for ShouldHaveBoth

func NewShouldHaveSecondRequest

func NewShouldHaveSecondRequest(server string, params ShouldHaveSecondParams) (*http.Request, error)

NewShouldHaveSecondRequest generates requests for ShouldHaveSecond

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) LeavePostOnlyPost

func (c *Client) LeavePostOnlyPost(ctx context.Context, params LeavePostOnlyPostParams) (*http.Response, error)

func (*Client) ShouldHaveBoth

func (c *Client) ShouldHaveBoth(ctx context.Context, params ShouldHaveBothParams) (*http.Response, error)

func (*Client) ShouldHaveSecond

func (c *Client) ShouldHaveSecond(ctx context.Context, params ShouldHaveSecondParams) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// LeavePostOnlyPost request
	LeavePostOnlyPost(ctx context.Context, params LeavePostOnlyPostParams) (*http.Response, error)

	// ShouldHaveBoth request
	ShouldHaveBoth(ctx context.Context, params ShouldHaveBothParams) (*http.Response, error)

	// ShouldHaveSecond request
	ShouldHaveSecond(ctx context.Context, params ShouldHaveSecondParams) (*http.Response, error)
}

The interface specification for the client above.

type ClientLeavePostOnlyPostResponse

type ClientLeavePostOnlyPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SchemaObject
}

func ParseLeavePostOnlyPostResponse

func ParseLeavePostOnlyPostResponse(rsp *http.Response) (*ClientLeavePostOnlyPostResponse, error)

ParseLeavePostOnlyPostResponse parses an HTTP response from a LeavePostOnlyPostWithResponse call

func (ClientLeavePostOnlyPostResponse) ResponseBody

func (r ClientLeavePostOnlyPostResponse) ResponseBody() []byte

ResponseBody returns HTTPResponse.Body as byte array

func (ClientLeavePostOnlyPostResponse) Status

Status returns HTTPResponse.Status

func (ClientLeavePostOnlyPostResponse) StatusCode

func (r ClientLeavePostOnlyPostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 ClientShouldHaveBothResponse

type ClientShouldHaveBothResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SchemaObject
}

func ParseShouldHaveBothResponse

func ParseShouldHaveBothResponse(rsp *http.Response) (*ClientShouldHaveBothResponse, error)

ParseShouldHaveBothResponse parses an HTTP response from a ShouldHaveBothWithResponse call

func (ClientShouldHaveBothResponse) ResponseBody

func (r ClientShouldHaveBothResponse) ResponseBody() []byte

ResponseBody returns HTTPResponse.Body as byte array

func (ClientShouldHaveBothResponse) Status

Status returns HTTPResponse.Status

func (ClientShouldHaveBothResponse) StatusCode

func (r ClientShouldHaveBothResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ClientShouldHaveSecondResponse

type ClientShouldHaveSecondResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SchemaObject
}

func ParseShouldHaveSecondResponse

func ParseShouldHaveSecondResponse(rsp *http.Response) (*ClientShouldHaveSecondResponse, error)

ParseShouldHaveSecondResponse parses an HTTP response from a ShouldHaveSecondWithResponse call

func (ClientShouldHaveSecondResponse) ResponseBody

func (r ClientShouldHaveSecondResponse) ResponseBody() []byte

ResponseBody returns HTTPResponse.Body as byte array

func (ClientShouldHaveSecondResponse) Status

Status returns HTTPResponse.Status

func (ClientShouldHaveSecondResponse) StatusCode

func (r ClientShouldHaveSecondResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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) LeavePostOnlyPostWithResponse

func (c *ClientWithResponses) LeavePostOnlyPostWithResponse(ctx context.Context, params LeavePostOnlyPostParams) (*ClientLeavePostOnlyPostResponse, error)

LeavePostOnlyPostWithResponse request returning *LeavePostOnlyPostResponse

func (*ClientWithResponses) ShouldHaveBothWithResponse

func (c *ClientWithResponses) ShouldHaveBothWithResponse(ctx context.Context, params ShouldHaveBothParams) (*ClientShouldHaveBothResponse, error)

ShouldHaveBothWithResponse request returning *ShouldHaveBothResponse

func (*ClientWithResponses) ShouldHaveSecondWithResponse

func (c *ClientWithResponses) ShouldHaveSecondWithResponse(ctx context.Context, params ShouldHaveSecondParams) (*ClientShouldHaveSecondResponse, error)

ShouldHaveSecondWithResponse request returning *ShouldHaveSecondResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// LeavePostOnlyPost request
	LeavePostOnlyPostWithResponse(ctx context.Context, params LeavePostOnlyPostParams) (*ClientLeavePostOnlyPostResponse, error)

	// ShouldHaveBoth request
	ShouldHaveBothWithResponse(ctx context.Context, params ShouldHaveBothParams) (*ClientShouldHaveBothResponse, error)

	// ShouldHaveSecond request
	ShouldHaveSecondWithResponse(ctx context.Context, params ShouldHaveSecondParams) (*ClientShouldHaveSecondResponse, error)
}

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

type FirstParam

type FirstParam = string

FirstParam defines model for FirstParam.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type LeavePostOnlyPostParams

type LeavePostOnlyPostParams struct {
	First  *FirstParam  `form:"first,omitempty" json:"first,omitempty"`
	Second *SecondParam `form:"second,omitempty" json:"second,omitempty"`
}

LeavePostOnlyPostParams defines parameters for LeavePostOnlyPost.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type SchemaObject

type SchemaObject struct {
	FirstName string `json:"firstName" validate:"required"`
	Role      string `json:"role" validate:"required"`
}

SchemaObject defines model for SchemaObject.

type SecondParam

type SecondParam = string

SecondParam defines model for SecondParam.

type ShouldHaveBothParams

type ShouldHaveBothParams struct {
	First  *FirstParam  `form:"first,omitempty" json:"first,omitempty"`
	Second *SecondParam `form:"second,omitempty" json:"second,omitempty"`
}

ShouldHaveBothParams defines parameters for ShouldHaveBoth.

type ShouldHaveSecondParams

type ShouldHaveSecondParams struct {
	Second *SecondParam `form:"second,omitempty" json:"second,omitempty"`
}

ShouldHaveSecondParams defines parameters for ShouldHaveSecond.

Jump to

Keyboard shortcuts

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