Documentation
¶
Overview ¶
Package apis provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.
Package apis provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.
Index ¶
- func GetSpec() (swagger *openapi3.T, err error)
- func GetSpecJSON() ([]byte, error)
- func GetSwagger() (*openapi3.T, error)deprecated
- func NewCreateSiteRequest(server string, siteName string) (*http.Request, error)
- func NewGetSiteRequest(server string, siteName string) (*http.Request, error)
- func NewPutSiteFileRequestWithBody(server string, siteName string, path string, contentType string, ...) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type Client
- func (c *Client) CreateSite(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetSite(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PutSiteFileWithBody(ctx context.Context, siteName string, path string, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*CreateSiteResponse, error)
- func (c *ClientWithResponses) GetSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*GetSiteResponse, error)
- func (c *ClientWithResponses) PutSiteFileWithBodyWithResponse(ctx context.Context, siteName string, path string, contentType string, ...) (*PutSiteFileResponse, error)
- type ClientWithResponsesInterface
- type CreateSiteResponse
- type ErrorDetail
- type ErrorModel
- type GetSiteResponse
- type HttpRequestDoer
- type PutSiteFileResponse
- type RequestEditorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSpec ¶
GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.
func GetSpecJSON ¶
GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.
func GetSwagger
deprecated
func NewCreateSiteRequest ¶
NewCreateSiteRequest generates requests for CreateSite
func NewGetSiteRequest ¶
NewGetSiteRequest generates requests for GetSite
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) CreateSite ¶
type ClientInterface ¶
type ClientInterface interface {
// GetSite request
GetSite(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateSite request
CreateSite(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutSiteFileWithBody request with any body
PutSiteFileWithBody(ctx context.Context, siteName string, path string, contentType string, body io.Reader, 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) CreateSiteWithResponse ¶
func (c *ClientWithResponses) CreateSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*CreateSiteResponse, error)
CreateSiteWithResponse request returning *CreateSiteResponse
func (*ClientWithResponses) GetSiteWithResponse ¶
func (c *ClientWithResponses) GetSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*GetSiteResponse, error)
GetSiteWithResponse request returning *GetSiteResponse
func (*ClientWithResponses) PutSiteFileWithBodyWithResponse ¶
func (c *ClientWithResponses) PutSiteFileWithBodyWithResponse(ctx context.Context, siteName string, path string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSiteFileResponse, error)
PutSiteFileWithBodyWithResponse request with arbitrary body returning *PutSiteFileResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetSiteWithResponse request
GetSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*GetSiteResponse, error)
// CreateSiteWithResponse request
CreateSiteWithResponse(ctx context.Context, siteName string, reqEditors ...RequestEditorFn) (*CreateSiteResponse, error)
// PutSiteFileWithBodyWithResponse request with any body
PutSiteFileWithBodyWithResponse(ctx context.Context, siteName string, path string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSiteFileResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateSiteResponse ¶
func ParseCreateSiteResponse ¶
func ParseCreateSiteResponse(rsp *http.Response) (*CreateSiteResponse, error)
ParseCreateSiteResponse parses an HTTP response from a CreateSiteWithResponse call
func (CreateSiteResponse) ContentType ¶
func (r CreateSiteResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CreateSiteResponse) Status ¶
func (r CreateSiteResponse) Status() string
Status returns HTTPResponse.Status
func (CreateSiteResponse) StatusCode ¶
func (r CreateSiteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ErrorDetail ¶
type ErrorDetail struct {
// Location Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
Location *string `json:"location,omitempty"`
// Message Error message text
Message *string `json:"message,omitempty"`
// Value The value at the given location
Value interface{} `json:"value,omitempty"`
}
ErrorDetail defines model for ErrorDetail.
type ErrorModel ¶
type ErrorModel struct {
// Schema A URL to the JSON Schema for this object.
Schema *string `json:"$schema,omitempty"`
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail *string `json:"detail,omitempty"`
// Errors Optional list of individual error details
Errors *[]ErrorDetail `json:"errors,omitempty"`
// Instance A URI reference that identifies the specific occurrence of the problem.
Instance *string `json:"instance,omitempty"`
// Status HTTP status code
Status *int64 `json:"status,omitempty"`
// Title A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Title *string `json:"title,omitempty"`
// Type A URI reference to human-readable documentation for the error.
Type *string `json:"type,omitempty"`
}
ErrorModel defines model for ErrorModel.
type GetSiteResponse ¶
func ParseGetSiteResponse ¶
func ParseGetSiteResponse(rsp *http.Response) (*GetSiteResponse, error)
ParseGetSiteResponse parses an HTTP response from a GetSiteWithResponse call
func (GetSiteResponse) ContentType ¶
func (r GetSiteResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetSiteResponse) Status ¶
func (r GetSiteResponse) Status() string
Status returns HTTPResponse.Status
func (GetSiteResponse) StatusCode ¶
func (r GetSiteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type PutSiteFileResponse ¶
type PutSiteFileResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSONDefault *ErrorModel
}
func ParsePutSiteFileResponse ¶
func ParsePutSiteFileResponse(rsp *http.Response) (*PutSiteFileResponse, error)
ParsePutSiteFileResponse parses an HTTP response from a PutSiteFileWithResponse call
func (PutSiteFileResponse) ContentType ¶
func (r PutSiteFileResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PutSiteFileResponse) Status ¶
func (r PutSiteFileResponse) Status() string
Status returns HTTPResponse.Status
func (PutSiteFileResponse) StatusCode ¶
func (r PutSiteFileResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode