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.6.1-0.20260318123712-00a90b7a03f4 DO NOT EDIT.
Index ¶
- func NewCreateResourceRequest(server string, params *CreateResourceParams, ...) (*http.Request, error)
- func NewCreateResourceRequestWithBody(server string, params *CreateResourceParams, contentType string, ...) (*http.Request, error)
- func NewDeleteResourceRequest(server string, resourceId ResourceIdPath) (*http.Request, error)
- func NewGetHealthRequest(server string) (*http.Request, error)
- func NewGetResourceRequest(server string, resourceId ResourceIdPath) (*http.Request, error)
- func NewListResourcesRequest(server string, params *ListResourcesParams) (*http.Request, error)
- func NewRehydrateResourceRequest(server string, resourceId ResourceIdPath, ...) (*http.Request, error)
- func NewRehydrateResourceRequestWithBody(server string, resourceId ResourceIdPath, contentType string, body io.Reader) (*http.Request, error)
- type Client
- func (c *Client) CreateResource(ctx context.Context, params *CreateResourceParams, ...) (*http.Response, error)
- func (c *Client) CreateResourceWithBody(ctx context.Context, params *CreateResourceParams, contentType string, ...) (*http.Response, error)
- func (c *Client) DeleteResource(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetResource(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListResources(ctx context.Context, params *ListResourcesParams, ...) (*http.Response, error)
- func (c *Client) RehydrateResource(ctx context.Context, resourceId ResourceIdPath, ...) (*http.Response, error)
- func (c *Client) RehydrateResourceWithBody(ctx context.Context, resourceId ResourceIdPath, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateResourceWithBodyWithResponse(ctx context.Context, params *CreateResourceParams, contentType string, ...) (*CreateResourceResponse, error)
- func (c *ClientWithResponses) CreateResourceWithResponse(ctx context.Context, params *CreateResourceParams, ...) (*CreateResourceResponse, error)
- func (c *ClientWithResponses) DeleteResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*DeleteResourceResponse, error)
- func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
- func (c *ClientWithResponses) GetResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*GetResourceResponse, error)
- func (c *ClientWithResponses) ListResourcesWithResponse(ctx context.Context, params *ListResourcesParams, ...) (*ListResourcesResponse, error)
- func (c *ClientWithResponses) RehydrateResourceWithBodyWithResponse(ctx context.Context, resourceId ResourceIdPath, contentType string, ...) (*RehydrateResourceResponse, error)
- func (c *ClientWithResponses) RehydrateResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, ...) (*RehydrateResourceResponse, error)
- type ClientWithResponsesInterface
- type CreateResourceResponse
- type DeleteResourceResponse
- type GetHealthResponse
- type GetResourceResponse
- type HttpRequestDoer
- type ListResourcesResponse
- type RehydrateResourceResponse
- type RequestEditorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateResourceRequest ¶
func NewCreateResourceRequest(server string, params *CreateResourceParams, body CreateResourceJSONRequestBody) (*http.Request, error)
NewCreateResourceRequest calls the generic CreateResource builder with application/json body
func NewCreateResourceRequestWithBody ¶
func NewCreateResourceRequestWithBody(server string, params *CreateResourceParams, contentType string, body io.Reader) (*http.Request, error)
NewCreateResourceRequestWithBody generates requests for CreateResource with any type of body
func NewDeleteResourceRequest ¶
NewDeleteResourceRequest generates requests for DeleteResource
func NewGetHealthRequest ¶
NewGetHealthRequest generates requests for GetHealth
func NewGetResourceRequest ¶
NewGetResourceRequest generates requests for GetResource
func NewListResourcesRequest ¶
NewListResourcesRequest generates requests for ListResources
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) CreateResource ¶
func (*Client) CreateResourceWithBody ¶
func (*Client) DeleteResource ¶
func (*Client) GetResource ¶
func (*Client) ListResources ¶
func (*Client) RehydrateResource ¶
type ClientInterface ¶
type ClientInterface interface {
// GetHealth request
GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListResources request
ListResources(ctx context.Context, params *ListResourcesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateResourceWithBody request with any body
CreateResourceWithBody(ctx context.Context, params *CreateResourceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateResource(ctx context.Context, params *CreateResourceParams, body CreateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteResource request
DeleteResource(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetResource request
GetResource(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)
// RehydrateResourceWithBody request with any body
RehydrateResourceWithBody(ctx context.Context, resourceId ResourceIdPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RehydrateResource(ctx context.Context, resourceId ResourceIdPath, body RehydrateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
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) CreateResourceWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateResourceWithBodyWithResponse(ctx context.Context, params *CreateResourceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResourceResponse, error)
CreateResourceWithBodyWithResponse request with arbitrary body returning *CreateResourceResponse
func (*ClientWithResponses) CreateResourceWithResponse ¶
func (c *ClientWithResponses) CreateResourceWithResponse(ctx context.Context, params *CreateResourceParams, body CreateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResourceResponse, error)
func (*ClientWithResponses) DeleteResourceWithResponse ¶
func (c *ClientWithResponses) DeleteResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*DeleteResourceResponse, error)
DeleteResourceWithResponse request returning *DeleteResourceResponse
func (*ClientWithResponses) GetHealthWithResponse ¶
func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
GetHealthWithResponse request returning *GetHealthResponse
func (*ClientWithResponses) GetResourceWithResponse ¶
func (c *ClientWithResponses) GetResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*GetResourceResponse, error)
GetResourceWithResponse request returning *GetResourceResponse
func (*ClientWithResponses) ListResourcesWithResponse ¶
func (c *ClientWithResponses) ListResourcesWithResponse(ctx context.Context, params *ListResourcesParams, reqEditors ...RequestEditorFn) (*ListResourcesResponse, error)
ListResourcesWithResponse request returning *ListResourcesResponse
func (*ClientWithResponses) RehydrateResourceWithBodyWithResponse ¶
func (c *ClientWithResponses) RehydrateResourceWithBodyWithResponse(ctx context.Context, resourceId ResourceIdPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RehydrateResourceResponse, error)
RehydrateResourceWithBodyWithResponse request with arbitrary body returning *RehydrateResourceResponse
func (*ClientWithResponses) RehydrateResourceWithResponse ¶
func (c *ClientWithResponses) RehydrateResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, body RehydrateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*RehydrateResourceResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetHealthWithResponse request
GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
// ListResourcesWithResponse request
ListResourcesWithResponse(ctx context.Context, params *ListResourcesParams, reqEditors ...RequestEditorFn) (*ListResourcesResponse, error)
// CreateResourceWithBodyWithResponse request with any body
CreateResourceWithBodyWithResponse(ctx context.Context, params *CreateResourceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResourceResponse, error)
CreateResourceWithResponse(ctx context.Context, params *CreateResourceParams, body CreateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResourceResponse, error)
// DeleteResourceWithResponse request
DeleteResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*DeleteResourceResponse, error)
// GetResourceWithResponse request
GetResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, reqEditors ...RequestEditorFn) (*GetResourceResponse, error)
// RehydrateResourceWithBodyWithResponse request with any body
RehydrateResourceWithBodyWithResponse(ctx context.Context, resourceId ResourceIdPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RehydrateResourceResponse, error)
RehydrateResourceWithResponse(ctx context.Context, resourceId ResourceIdPath, body RehydrateResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*RehydrateResourceResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateResourceResponse ¶
type CreateResourceResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Resource
ApplicationproblemJSON400 *Error
ApplicationproblemJSON406 *Error
ApplicationproblemJSON409 *Error
ApplicationproblemJSON422 *Error
ApplicationproblemJSONDefault *Error
}
func ParseCreateResourceResponse ¶
func ParseCreateResourceResponse(rsp *http.Response) (*CreateResourceResponse, error)
ParseCreateResourceResponse parses an HTTP response from a CreateResourceWithResponse call
func (CreateResourceResponse) Status ¶
func (r CreateResourceResponse) Status() string
Status returns HTTPResponse.Status
func (CreateResourceResponse) StatusCode ¶
func (r CreateResourceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteResourceResponse ¶
type DeleteResourceResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSON400 *Error
ApplicationproblemJSON404 *Error
ApplicationproblemJSON422 *Error
ApplicationproblemJSONDefault *Error
}
func ParseDeleteResourceResponse ¶
func ParseDeleteResourceResponse(rsp *http.Response) (*DeleteResourceResponse, error)
ParseDeleteResourceResponse parses an HTTP response from a DeleteResourceWithResponse call
func (DeleteResourceResponse) Status ¶
func (r DeleteResourceResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteResourceResponse) StatusCode ¶
func (r DeleteResourceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetHealthResponse ¶
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 GetResourceResponse ¶
type GetResourceResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Resource
ApplicationproblemJSON400 *Error
ApplicationproblemJSON404 *Error
ApplicationproblemJSONDefault *Error
}
func ParseGetResourceResponse ¶
func ParseGetResourceResponse(rsp *http.Response) (*GetResourceResponse, error)
ParseGetResourceResponse parses an HTTP response from a GetResourceWithResponse call
func (GetResourceResponse) Status ¶
func (r GetResourceResponse) Status() string
Status returns HTTPResponse.Status
func (GetResourceResponse) StatusCode ¶
func (r GetResourceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListResourcesResponse ¶
type ListResourcesResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ResourceList
ApplicationproblemJSON400 *Error
ApplicationproblemJSONDefault *Error
}
func ParseListResourcesResponse ¶
func ParseListResourcesResponse(rsp *http.Response) (*ListResourcesResponse, error)
ParseListResourcesResponse parses an HTTP response from a ListResourcesWithResponse call
func (ListResourcesResponse) Status ¶
func (r ListResourcesResponse) Status() string
Status returns HTTPResponse.Status
func (ListResourcesResponse) StatusCode ¶
func (r ListResourcesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RehydrateResourceResponse ¶
type RehydrateResourceResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Resource
ApplicationproblemJSON400 *Error
ApplicationproblemJSON404 *Error
ApplicationproblemJSON406 *Error
ApplicationproblemJSON409 *Error
ApplicationproblemJSON422 *Error
ApplicationproblemJSONDefault *Error
}
func ParseRehydrateResourceResponse ¶
func ParseRehydrateResourceResponse(rsp *http.Response) (*RehydrateResourceResponse, error)
ParseRehydrateResourceResponse parses an HTTP response from a RehydrateResourceWithResponse call
func (RehydrateResourceResponse) Status ¶
func (r RehydrateResourceResponse) Status() string
Status returns HTTPResponse.Status
func (RehydrateResourceResponse) StatusCode ¶
func (r RehydrateResourceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode