client

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 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 NewCreateCertificateSigningRequestRequest added in v0.9.0

func NewCreateCertificateSigningRequestRequest(server string, body CreateCertificateSigningRequestJSONRequestBody) (*http.Request, error)

NewCreateCertificateSigningRequestRequest calls the generic CreateCertificateSigningRequest builder with application/json body

func NewCreateCertificateSigningRequestRequestWithBody added in v0.9.0

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

NewCreateCertificateSigningRequestRequestWithBody generates requests for CreateCertificateSigningRequest with any type of body

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 NewGetCertificateSigningRequestRequest added in v0.9.0

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

NewGetCertificateSigningRequestRequest generates requests for GetCertificateSigningRequest

func NewGetEnrollmentRequestRequest added in v0.9.0

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

NewGetEnrollmentRequestRequest generates requests for GetEnrollmentRequest

func NewGetRenderedDeviceRequest added in v0.5.0

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

NewGetRenderedDeviceRequest generates requests for GetRenderedDevice

func NewPatchDeviceStatusRequestWithApplicationJSONPatchPlusJSONBody added in v0.6.0

func NewPatchDeviceStatusRequestWithApplicationJSONPatchPlusJSONBody(server string, name string, body PatchDeviceStatusApplicationJSONPatchPlusJSONRequestBody) (*http.Request, error)

NewPatchDeviceStatusRequestWithApplicationJSONPatchPlusJSONBody calls the generic PatchDeviceStatus builder with application/json-patch+json body

func NewPatchDeviceStatusRequestWithBody added in v0.6.0

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

NewPatchDeviceStatusRequestWithBody generates requests for PatchDeviceStatus with any type of body

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) CreateCertificateSigningRequest added in v0.9.0

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

func (*Client) CreateCertificateSigningRequestWithBody added in v0.9.0

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

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) GetCertificateSigningRequest added in v0.9.0

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

func (*Client) GetEnrollmentRequest added in v0.9.0

func (c *Client) GetEnrollmentRequest(ctx context.Context, name string, 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) PatchDeviceStatusWithApplicationJSONPatchPlusJSONBody added in v0.6.0

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

func (*Client) PatchDeviceStatusWithBody added in v0.6.0

func (c *Client) PatchDeviceStatusWithBody(ctx context.Context, name string, contentType string, body io.Reader, 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 {
	// CreateCertificateSigningRequestWithBody request with any body
	CreateCertificateSigningRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateCertificateSigningRequest(ctx context.Context, body CreateCertificateSigningRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

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

	PatchDeviceStatusWithApplicationJSONPatchPlusJSONBody(ctx context.Context, name string, body PatchDeviceStatusApplicationJSONPatchPlusJSONRequestBody, 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)

	// GetEnrollmentRequest request
	GetEnrollmentRequest(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) CreateCertificateSigningRequestWithBodyWithResponse added in v0.9.0

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

CreateCertificateSigningRequestWithBodyWithResponse request with arbitrary body returning *CreateCertificateSigningRequestResponse

func (*ClientWithResponses) CreateCertificateSigningRequestWithResponse added in v0.9.0

func (c *ClientWithResponses) CreateCertificateSigningRequestWithResponse(ctx context.Context, body CreateCertificateSigningRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCertificateSigningRequestResponse, error)

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) GetCertificateSigningRequestWithResponse added in v0.9.0

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

GetCertificateSigningRequestWithResponse request returning *GetCertificateSigningRequestResponse

func (*ClientWithResponses) GetEnrollmentRequestWithResponse added in v0.9.0

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

GetEnrollmentRequestWithResponse request returning *GetEnrollmentRequestResponse

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) PatchDeviceStatusWithApplicationJSONPatchPlusJSONBodyWithResponse added in v0.6.0

func (c *ClientWithResponses) PatchDeviceStatusWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, name string, body PatchDeviceStatusApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchDeviceStatusResponse, error)

func (*ClientWithResponses) PatchDeviceStatusWithBodyWithResponse added in v0.6.0

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

PatchDeviceStatusWithBodyWithResponse request with arbitrary body returning *PatchDeviceStatusResponse

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 {
	// CreateCertificateSigningRequestWithBodyWithResponse request with any body
	CreateCertificateSigningRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCertificateSigningRequestResponse, error)

	CreateCertificateSigningRequestWithResponse(ctx context.Context, body CreateCertificateSigningRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCertificateSigningRequestResponse, error)

	// GetCertificateSigningRequestWithResponse request
	GetCertificateSigningRequestWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetCertificateSigningRequestResponse, error)

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

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

	PatchDeviceStatusWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, name string, body PatchDeviceStatusApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchDeviceStatusResponse, 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)

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

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

type CreateCertificateSigningRequestResponse added in v0.9.0

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

func ParseCreateCertificateSigningRequestResponse added in v0.9.0

func ParseCreateCertificateSigningRequestResponse(rsp *http.Response) (*CreateCertificateSigningRequestResponse, error)

ParseCreateCertificateSigningRequestResponse parses an HTTP response from a CreateCertificateSigningRequestWithResponse call

func (CreateCertificateSigningRequestResponse) Status added in v0.9.0

Status returns HTTPResponse.Status

func (CreateCertificateSigningRequestResponse) StatusCode added in v0.9.0

StatusCode returns HTTPResponse.StatusCode

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 GetCertificateSigningRequestResponse added in v0.9.0

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

func ParseGetCertificateSigningRequestResponse added in v0.9.0

func ParseGetCertificateSigningRequestResponse(rsp *http.Response) (*GetCertificateSigningRequestResponse, error)

ParseGetCertificateSigningRequestResponse parses an HTTP response from a GetCertificateSigningRequestWithResponse call

func (GetCertificateSigningRequestResponse) Status added in v0.9.0

Status returns HTTPResponse.Status

func (GetCertificateSigningRequestResponse) StatusCode added in v0.9.0

StatusCode returns HTTPResponse.StatusCode

type GetEnrollmentRequestResponse added in v0.9.0

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

func ParseGetEnrollmentRequestResponse added in v0.9.0

func ParseGetEnrollmentRequestResponse(rsp *http.Response) (*GetEnrollmentRequestResponse, error)

ParseGetEnrollmentRequestResponse parses an HTTP response from a GetEnrollmentRequestWithResponse call

func (GetEnrollmentRequestResponse) Status added in v0.9.0

Status returns HTTPResponse.Status

func (GetEnrollmentRequestResponse) StatusCode added in v0.9.0

func (r GetEnrollmentRequestResponse) 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 PatchDeviceStatusResponse added in v0.6.0

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

func ParsePatchDeviceStatusResponse added in v0.6.0

func ParsePatchDeviceStatusResponse(rsp *http.Response) (*PatchDeviceStatusResponse, error)

ParsePatchDeviceStatusResponse parses an HTTP response from a PatchDeviceStatusWithResponse call

func (PatchDeviceStatusResponse) Status added in v0.6.0

func (r PatchDeviceStatusResponse) Status() string

Status returns HTTPResponse.Status

func (PatchDeviceStatusResponse) StatusCode added in v0.6.0

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