Documentation
¶
Overview ¶
Package internal provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- func NewAddScopeRequest(server string, body AddScopeJSONRequestBody) (*http.Request, error)
- func NewAddScopeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteScopeRequest(server string, id string) (*http.Request, error)
- func NewGetScopeRequest(server string, id string) (*http.Request, error)
- func NewGetScopesRequest(server string) (*http.Request, error)
- func NewUpdateScopeRequest(server string, id string, body UpdateScopeJSONRequestBody) (*http.Request, error)
- func NewUpdateScopeRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error)
- type AddScopeJSONRequestBody
- type AddScopeResponse
- type BadRequest
- type Client
- func (c *Client) AddScope(ctx context.Context, body AddScopeJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) AddScopeWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) DeleteScope(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetScope(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetScopes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) UpdateScope(ctx context.Context, id string, body UpdateScopeJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateScopeWithBody(ctx context.Context, id string, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AddScopeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*AddScopeResponse, error)
- func (c *ClientWithResponses) AddScopeWithResponse(ctx context.Context, body AddScopeJSONRequestBody, ...) (*AddScopeResponse, error)
- func (c *ClientWithResponses) DeleteScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteScopeResponse, error)
- func (c *ClientWithResponses) GetScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetScopeResponse, error)
- func (c *ClientWithResponses) GetScopesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetScopesResponse, error)
- func (c *ClientWithResponses) UpdateScopeWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, ...) (*UpdateScopeResponse, error)
- func (c *ClientWithResponses) UpdateScopeWithResponse(ctx context.Context, id string, body UpdateScopeJSONRequestBody, ...) (*UpdateScopeResponse, error)
- type ClientWithResponsesInterface
- type Conflict
- type DeleteScopeResponse
- type ErrorResponse
- type GetScopeResponse
- type GetScopesResponse
- type HttpRequestDoer
- type InvalidInput
- type NotFound
- type RequestEditorFn
- type Scope
- type ScopeUpdateRequest
- type ServerError
- type UpdateScopeJSONRequestBody
- type UpdateScopeResponse
Constants ¶
const ( BasicAuthScopes = "BasicAuth.Scopes" OAuth2Scopes = "OAuth2.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func NewAddScopeRequest ¶
func NewAddScopeRequest(server string, body AddScopeJSONRequestBody) (*http.Request, error)
NewAddScopeRequest calls the generic AddScope builder with application/json body
func NewAddScopeRequestWithBody ¶
func NewAddScopeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewAddScopeRequestWithBody generates requests for AddScope with any type of body
func NewDeleteScopeRequest ¶
NewDeleteScopeRequest generates requests for DeleteScope
func NewGetScopeRequest ¶
NewGetScopeRequest generates requests for GetScope
func NewGetScopesRequest ¶
NewGetScopesRequest generates requests for GetScopes
func NewUpdateScopeRequest ¶
func NewUpdateScopeRequest(server string, id string, body UpdateScopeJSONRequestBody) (*http.Request, error)
NewUpdateScopeRequest calls the generic UpdateScope builder with application/json body
Types ¶
type AddScopeJSONRequestBody ¶
type AddScopeJSONRequestBody = Scope
AddScopeJSONRequestBody defines body for AddScope for application/json ContentType.
type AddScopeResponse ¶
type AddScopeResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *InvalidInput
JSON409 *Conflict
JSON500 *ServerError
}
func ParseAddScopeResponse ¶
func ParseAddScopeResponse(rsp *http.Response) (*AddScopeResponse, error)
ParseAddScopeResponse parses an HTTP response from a AddScopeWithResponse call
func (AddScopeResponse) Status ¶
func (r AddScopeResponse) Status() string
Status returns HTTPResponse.Status
func (AddScopeResponse) StatusCode ¶
func (r AddScopeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
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) AddScope ¶
func (c *Client) AddScope(ctx context.Context, body AddScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) AddScopeWithBody ¶
func (*Client) DeleteScope ¶
func (*Client) UpdateScope ¶
func (c *Client) UpdateScope(ctx context.Context, id string, body UpdateScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// GetScopes request
GetScopes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// AddScopeWithBody request with any body
AddScopeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
AddScope(ctx context.Context, body AddScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteScope request
DeleteScope(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetScope request
GetScope(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateScopeWithBody request with any body
UpdateScopeWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateScope(ctx context.Context, id string, body UpdateScopeJSONRequestBody, 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) AddScopeWithBodyWithResponse ¶
func (c *ClientWithResponses) AddScopeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddScopeResponse, error)
AddScopeWithBodyWithResponse request with arbitrary body returning *AddScopeResponse
func (*ClientWithResponses) AddScopeWithResponse ¶
func (c *ClientWithResponses) AddScopeWithResponse(ctx context.Context, body AddScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*AddScopeResponse, error)
func (*ClientWithResponses) DeleteScopeWithResponse ¶
func (c *ClientWithResponses) DeleteScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteScopeResponse, error)
DeleteScopeWithResponse request returning *DeleteScopeResponse
func (*ClientWithResponses) GetScopeWithResponse ¶
func (c *ClientWithResponses) GetScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetScopeResponse, error)
GetScopeWithResponse request returning *GetScopeResponse
func (*ClientWithResponses) GetScopesWithResponse ¶
func (c *ClientWithResponses) GetScopesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetScopesResponse, error)
GetScopesWithResponse request returning *GetScopesResponse
func (*ClientWithResponses) UpdateScopeWithBodyWithResponse ¶
func (c *ClientWithResponses) UpdateScopeWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateScopeResponse, error)
UpdateScopeWithBodyWithResponse request with arbitrary body returning *UpdateScopeResponse
func (*ClientWithResponses) UpdateScopeWithResponse ¶
func (c *ClientWithResponses) UpdateScopeWithResponse(ctx context.Context, id string, body UpdateScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateScopeResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetScopesWithResponse request
GetScopesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetScopesResponse, error)
// AddScopeWithBodyWithResponse request with any body
AddScopeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddScopeResponse, error)
AddScopeWithResponse(ctx context.Context, body AddScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*AddScopeResponse, error)
// DeleteScopeWithResponse request
DeleteScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteScopeResponse, error)
// GetScopeWithResponse request
GetScopeWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetScopeResponse, error)
// UpdateScopeWithBodyWithResponse request with any body
UpdateScopeWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateScopeResponse, error)
UpdateScopeWithResponse(ctx context.Context, id string, body UpdateScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateScopeResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DeleteScopeResponse ¶
type DeleteScopeResponse struct {
Body []byte
HTTPResponse *http.Response
JSON500 *ServerError
}
func ParseDeleteScopeResponse ¶
func ParseDeleteScopeResponse(rsp *http.Response) (*DeleteScopeResponse, error)
ParseDeleteScopeResponse parses an HTTP response from a DeleteScopeWithResponse call
func (DeleteScopeResponse) Status ¶
func (r DeleteScopeResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteScopeResponse) StatusCode ¶
func (r DeleteScopeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ErrorResponse ¶
type ErrorResponse struct {
Code string `json:"code"`
Description *string `json:"description,omitempty"`
Message string `json:"message"`
TraceId *string `json:"traceId,omitempty"`
}
ErrorResponse defines model for ErrorResponse.
type GetScopeResponse ¶
type GetScopeResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Scope
JSON404 *NotFound
JSON500 *ServerError
}
func ParseGetScopeResponse ¶
func ParseGetScopeResponse(rsp *http.Response) (*GetScopeResponse, error)
ParseGetScopeResponse parses an HTTP response from a GetScopeWithResponse call
func (GetScopeResponse) Status ¶
func (r GetScopeResponse) Status() string
Status returns HTTPResponse.Status
func (GetScopeResponse) StatusCode ¶
func (r GetScopeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetScopesResponse ¶
type GetScopesResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Scope
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *ServerError
}
func ParseGetScopesResponse ¶
func ParseGetScopesResponse(rsp *http.Response) (*GetScopesResponse, error)
ParseGetScopesResponse parses an HTTP response from a GetScopesWithResponse call
func (GetScopesResponse) Status ¶
func (r GetScopesResponse) Status() string
Status returns HTTPResponse.Status
func (GetScopesResponse) StatusCode ¶
func (r GetScopesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Scope ¶
type Scope struct {
Claims []string `json:"claims"`
Description *string `json:"description,omitempty"`
DisplayName string `json:"displayName"`
Name string `json:"name"`
}
Scope defines model for Scope.
type ScopeUpdateRequest ¶
type ScopeUpdateRequest struct {
Claims []string `json:"claims"`
Description *string `json:"description,omitempty"`
DisplayName string `json:"displayName"`
}
ScopeUpdateRequest defines model for ScopeUpdateRequest.
type UpdateScopeJSONRequestBody ¶
type UpdateScopeJSONRequestBody = ScopeUpdateRequest
UpdateScopeJSONRequestBody defines body for UpdateScope for application/json ContentType.
type UpdateScopeResponse ¶
type UpdateScopeResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *InvalidInput
JSON404 *NotFound
JSON500 *ServerError
}
func ParseUpdateScopeResponse ¶
func ParseUpdateScopeResponse(rsp *http.Response) (*UpdateScopeResponse, error)
ParseUpdateScopeResponse parses an HTTP response from a UpdateScopeWithResponse call
func (UpdateScopeResponse) Status ¶
func (r UpdateScopeResponse) Status() string
Status returns HTTPResponse.Status
func (UpdateScopeResponse) StatusCode ¶
func (r UpdateScopeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode