client

package
v0.6.0-main Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateEnrollmentRequestRequest

func NewCreateEnrollmentRequestRequest(server string, body CreateEnrollmentRequestJSONRequestBody) (*http.Request, error)

NewCreateEnrollmentRequestRequest calls the generic CreateEnrollmentRequest builder with application/json body

func NewCreateEnrollmentRequestRequestWithBody

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

NewCreateEnrollmentRequestRequestWithBody generates requests for CreateEnrollmentRequest with any type of body

func NewGetRenderedDeviceRequest added in v0.5.0

func NewGetRenderedDeviceRequest(server string, name string, params *GetRenderedDeviceParams) (*http.Request, error)

NewGetRenderedDeviceRequest generates requests for GetRenderedDevice

func NewReadEnrollmentRequestRequest

func NewReadEnrollmentRequestRequest(server string, name string) (*http.Request, error)

NewReadEnrollmentRequestRequest generates requests for ReadEnrollmentRequest

func NewReplaceDeviceStatusRequest

func NewReplaceDeviceStatusRequest(server string, name string, body ReplaceDeviceStatusJSONRequestBody) (*http.Request, error)

NewReplaceDeviceStatusRequest calls the generic ReplaceDeviceStatus builder with application/json body

func NewReplaceDeviceStatusRequestWithBody

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

NewReplaceDeviceStatusRequestWithBody generates requests for ReplaceDeviceStatus 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) CreateEnrollmentRequest

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

func (*Client) CreateEnrollmentRequestWithBody

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

func (*Client) GetRenderedDevice added in v0.5.0

func (c *Client) GetRenderedDevice(ctx context.Context, name string, params *GetRenderedDeviceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ReadEnrollmentRequest

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

func (*Client) ReplaceDeviceStatus

func (c *Client) ReplaceDeviceStatus(ctx context.Context, name string, body ReplaceDeviceStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ReplaceDeviceStatusWithBody

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

type ClientInterface

type ClientInterface interface {
	// GetRenderedDevice request
	GetRenderedDevice(ctx context.Context, name string, params *GetRenderedDeviceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	ReplaceDeviceStatus(ctx context.Context, name string, body ReplaceDeviceStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateEnrollmentRequest(ctx context.Context, body CreateEnrollmentRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReadEnrollmentRequest request
	ReadEnrollmentRequest(ctx context.Context, name string, 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) CreateEnrollmentRequestWithBodyWithResponse

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

CreateEnrollmentRequestWithBodyWithResponse request with arbitrary body returning *CreateEnrollmentRequestResponse

func (*ClientWithResponses) CreateEnrollmentRequestWithResponse

func (c *ClientWithResponses) CreateEnrollmentRequestWithResponse(ctx context.Context, body CreateEnrollmentRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEnrollmentRequestResponse, error)

func (*ClientWithResponses) GetRenderedDeviceWithResponse added in v0.5.0

func (c *ClientWithResponses) GetRenderedDeviceWithResponse(ctx context.Context, name string, params *GetRenderedDeviceParams, reqEditors ...RequestEditorFn) (*GetRenderedDeviceResponse, error)

GetRenderedDeviceWithResponse request returning *GetRenderedDeviceResponse

func (*ClientWithResponses) ReadEnrollmentRequestWithResponse

func (c *ClientWithResponses) ReadEnrollmentRequestWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ReadEnrollmentRequestResponse, error)

ReadEnrollmentRequestWithResponse request returning *ReadEnrollmentRequestResponse

func (*ClientWithResponses) ReplaceDeviceStatusWithBodyWithResponse

func (c *ClientWithResponses) ReplaceDeviceStatusWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReplaceDeviceStatusResponse, error)

ReplaceDeviceStatusWithBodyWithResponse request with arbitrary body returning *ReplaceDeviceStatusResponse

func (*ClientWithResponses) ReplaceDeviceStatusWithResponse

func (c *ClientWithResponses) ReplaceDeviceStatusWithResponse(ctx context.Context, name string, body ReplaceDeviceStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*ReplaceDeviceStatusResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetRenderedDeviceWithResponse request
	GetRenderedDeviceWithResponse(ctx context.Context, name string, params *GetRenderedDeviceParams, reqEditors ...RequestEditorFn) (*GetRenderedDeviceResponse, error)

	// ReplaceDeviceStatusWithBodyWithResponse request with any body
	ReplaceDeviceStatusWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReplaceDeviceStatusResponse, error)

	ReplaceDeviceStatusWithResponse(ctx context.Context, name string, body ReplaceDeviceStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*ReplaceDeviceStatusResponse, error)

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

	CreateEnrollmentRequestWithResponse(ctx context.Context, body CreateEnrollmentRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEnrollmentRequestResponse, error)

	// ReadEnrollmentRequestWithResponse request
	ReadEnrollmentRequestWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ReadEnrollmentRequestResponse, error)
}

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

type CreateEnrollmentRequestResponse

type CreateEnrollmentRequestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *externalRef0.EnrollmentRequest
	JSON400      *externalRef0.Status
	JSON401      *externalRef0.Status
	JSON403      *externalRef0.Status
	JSON409      *externalRef0.Status
	JSON503      *externalRef0.Status
}

func ParseCreateEnrollmentRequestResponse

func ParseCreateEnrollmentRequestResponse(rsp *http.Response) (*CreateEnrollmentRequestResponse, error)

ParseCreateEnrollmentRequestResponse parses an HTTP response from a CreateEnrollmentRequestWithResponse call

func (CreateEnrollmentRequestResponse) Status

Status returns HTTPResponse.Status

func (CreateEnrollmentRequestResponse) StatusCode

func (r CreateEnrollmentRequestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRenderedDeviceResponse added in v0.5.0

type GetRenderedDeviceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef0.Device
	JSON401      *externalRef0.Status
	JSON404      *externalRef0.Status
	JSON409      *externalRef0.Status
}

func ParseGetRenderedDeviceResponse added in v0.5.0

func ParseGetRenderedDeviceResponse(rsp *http.Response) (*GetRenderedDeviceResponse, error)

ParseGetRenderedDeviceResponse parses an HTTP response from a GetRenderedDeviceWithResponse call

func (GetRenderedDeviceResponse) Status added in v0.5.0

func (r GetRenderedDeviceResponse) Status() string

Status returns HTTPResponse.Status

func (GetRenderedDeviceResponse) StatusCode added in v0.5.0

func (r GetRenderedDeviceResponse) 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 ReadEnrollmentRequestResponse

type ReadEnrollmentRequestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef0.EnrollmentRequest
	JSON401      *externalRef0.Status
	JSON403      *externalRef0.Status
	JSON404      *externalRef0.Status
	JSON503      *externalRef0.Status
}

func ParseReadEnrollmentRequestResponse

func ParseReadEnrollmentRequestResponse(rsp *http.Response) (*ReadEnrollmentRequestResponse, error)

ParseReadEnrollmentRequestResponse parses an HTTP response from a ReadEnrollmentRequestWithResponse call

func (ReadEnrollmentRequestResponse) Status

Status returns HTTPResponse.Status

func (ReadEnrollmentRequestResponse) StatusCode

func (r ReadEnrollmentRequestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ReplaceDeviceStatusResponse

type ReplaceDeviceStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef0.Device
	JSON400      *externalRef0.Status
	JSON401      *externalRef0.Status
	JSON404      *externalRef0.Status
}

func ParseReplaceDeviceStatusResponse

func ParseReplaceDeviceStatusResponse(rsp *http.Response) (*ReplaceDeviceStatusResponse, error)

ParseReplaceDeviceStatusResponse parses an HTTP response from a ReplaceDeviceStatusWithResponse call

func (ReplaceDeviceStatusResponse) Status

Status returns HTTPResponse.Status

func (ReplaceDeviceStatusResponse) StatusCode

func (r ReplaceDeviceStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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