cpv1

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cpv1 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.10.1 DO NOT EDIT.

Package cpv1 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.10.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetApiCredentialIntrospectionRequest

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

NewGetApiCredentialIntrospectionRequest generates requests for GetApiCredentialIntrospection

Types

type ApiError

type ApiError struct {
	// An error code identifying the error
	Code *ApiErrorCode `json:"code,omitempty"`

	// A descriptive message about the error meant for developer consumption
	Message *string `json:"message,omitempty"`

	// Optional error specific attributes
	Params *ApiError_Params `json:"params,omitempty"`

	// An optional service or domain specific error group
	Type *ApiErrorType `json:"type,omitempty"`
}

ApiError defines model for ApiError.

type ApiErrorCode

type ApiErrorCode string

An error code identifying the error

const (
	ApiErrorCodeApiGuardError ApiErrorCode = "api_guard_error"

	ApiErrorCodeApiGuardInvalidCredentials ApiErrorCode = "api_guard_invalid_credentials"

	ApiErrorCodeApiGuardRateLimitExceeded ApiErrorCode = "api_guard_rate_limit_exceeded"

	ApiErrorCodeApiGuardUnauthorized ApiErrorCode = "api_guard_unauthorized"

	ApiErrorCodeAppFeatureNotEnabled ApiErrorCode = "app_feature_not_enabled"

	ApiErrorCodeAppGenericError ApiErrorCode = "app_generic_error"

	ApiErrorCodeAppInsufficientParameters ApiErrorCode = "app_insufficient_parameters"

	ApiErrorCodeAppPackageVersionNotFound ApiErrorCode = "app_package_version_not_found"

	ApiErrorCodeAppSecurityError ApiErrorCode = "app_security_error"
)

Defines values for ApiErrorCode.

type ApiErrorType

type ApiErrorType string

An optional service or domain specific error group

const (
	ApiErrorTypeInternalError ApiErrorType = "internal_error"

	ApiErrorTypeInvalidRequest ApiErrorType = "invalid_request"

	ApiErrorTypeOperationFailed ApiErrorType = "operation_failed"
)

Defines values for ApiErrorType.

type ApiError_Params

type ApiError_Params struct {
	AdditionalProperties map[string]struct {
		Key   *string `json:"key,omitempty"`
		Value *string `json:"value,omitempty"`
	} `json:"-"`
}

Optional error specific attributes

func (ApiError_Params) Get

func (a ApiError_Params) Get(fieldName string) (value struct {
	Key   *string `json:"key,omitempty"`
	Value *string `json:"value,omitempty"`
}, found bool)

Getter for additional properties for ApiError_Params. Returns the specified element and whether it was found

func (ApiError_Params) MarshalJSON

func (a ApiError_Params) MarshalJSON() ([]byte, error)

Override default JSON handling for ApiError_Params to handle AdditionalProperties

func (*ApiError_Params) Set

func (a *ApiError_Params) Set(fieldName string, value struct {
	Key   *string `json:"key,omitempty"`
	Value *string `json:"value,omitempty"`
})

Setter for additional properties for ApiError_Params

func (*ApiError_Params) UnmarshalJSON

func (a *ApiError_Params) UnmarshalJSON(b []byte) error

Override default JSON handling for ApiError_Params to handle AdditionalProperties

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

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

type ClientInterface

type ClientInterface interface {
	// GetApiCredentialIntrospection request
	GetApiCredentialIntrospection(ctx context.Context, 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) GetApiCredentialIntrospectionWithResponse

func (c *ClientWithResponses) GetApiCredentialIntrospectionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetApiCredentialIntrospectionResponse, error)

GetApiCredentialIntrospectionWithResponse request returning *GetApiCredentialIntrospectionResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetApiCredentialIntrospection request
	GetApiCredentialIntrospectionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetApiCredentialIntrospectionResponse, error)
}

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

type CredentialIntrospectionResponse

type CredentialIntrospectionResponse struct {
	// Expiry timestamp in RFC3399 format if expirable
	Expiry *string `json:"expiry,omitempty"`

	// The entity type to which this credential belongs to
	Type CredentialIntrospectionResponseType `json:"type"`
}

CredentialIntrospectionResponse defines model for CredentialIntrospectionResponse.

type CredentialIntrospectionResponseType

type CredentialIntrospectionResponseType string

The entity type to which this credential belongs to

const (
	CredentialIntrospectionResponseTypeOrganization CredentialIntrospectionResponseType = "Organization"

	CredentialIntrospectionResponseTypeTeam CredentialIntrospectionResponseType = "Team"

	CredentialIntrospectionResponseTypeTrialUser CredentialIntrospectionResponseType = "TrialUser"

	CredentialIntrospectionResponseTypeUser CredentialIntrospectionResponseType = "User"
)

Defines values for CredentialIntrospectionResponseType.

type GetApiCredentialIntrospectionResponse

type GetApiCredentialIntrospectionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CredentialIntrospectionResponse
	JSON403      *ApiError
	JSON429      *ApiError
	JSON500      *ApiError
}

func ParseGetApiCredentialIntrospectionResponse

func ParseGetApiCredentialIntrospectionResponse(rsp *http.Response) (*GetApiCredentialIntrospectionResponse, error)

ParseGetApiCredentialIntrospectionResponse parses an HTTP response from a GetApiCredentialIntrospectionWithResponse call

func (GetApiCredentialIntrospectionResponse) Status

Status returns HTTPResponse.Status

func (GetApiCredentialIntrospectionResponse) StatusCode

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