internal

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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

View Source
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

func NewDeleteScopeRequest(server string, id string) (*http.Request, error)

NewDeleteScopeRequest generates requests for DeleteScope

func NewGetScopeRequest

func NewGetScopeRequest(server string, id string) (*http.Request, error)

NewGetScopeRequest generates requests for GetScope

func NewGetScopesRequest

func NewGetScopesRequest(server string) (*http.Request, error)

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

func NewUpdateScopeRequestWithBody

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

NewUpdateScopeRequestWithBody generates requests for UpdateScope with any type of 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 BadRequest

type BadRequest = ErrorResponse

BadRequest defines model for BadRequest.

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 (c *Client) AddScopeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteScope

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

func (*Client) GetScope

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

func (*Client) GetScopes

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

func (*Client) UpdateScope

func (c *Client) UpdateScope(ctx context.Context, id string, body UpdateScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateScopeWithBody

func (c *Client) UpdateScopeWithBody(ctx context.Context, id string, contentType string, body io.Reader, 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

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) 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 Conflict

type Conflict = ErrorResponse

Conflict defines model for Conflict.

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

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidInput

type InvalidInput = ErrorResponse

InvalidInput defines model for InvalidInput.

type NotFound

type NotFound = ErrorResponse

NotFound defines model for NotFound.

type RequestEditorFn

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

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 ServerError

type ServerError = ErrorResponse

ServerError defines model for ServerError.

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

Jump to

Keyboard shortcuts

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