cpv1trials

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cpv1trials 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 cpv1trials 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 NewRegisterTrialUserRequest

func NewRegisterTrialUserRequest(server string, body RegisterTrialUserJSONRequestBody) (*http.Request, error)

NewRegisterTrialUserRequest calls the generic RegisterTrialUser builder with application/json body

func NewRegisterTrialUserRequestWithBody

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

NewRegisterTrialUserRequestWithBody generates requests for RegisterTrialUser with any type of body

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

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

func (*Client) RegisterTrialUserWithBody

func (c *Client) RegisterTrialUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// RegisterTrialUser request with any body
	RegisterTrialUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	RegisterTrialUser(ctx context.Context, body RegisterTrialUserJSONRequestBody, 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) RegisterTrialUserWithBodyWithResponse

func (c *ClientWithResponses) RegisterTrialUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterTrialUserResponse, error)

RegisterTrialUserWithBodyWithResponse request with arbitrary body returning *RegisterTrialUserResponse

func (*ClientWithResponses) RegisterTrialUserWithResponse

func (c *ClientWithResponses) RegisterTrialUserWithResponse(ctx context.Context, body RegisterTrialUserJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisterTrialUserResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// RegisterTrialUser request with any body
	RegisterTrialUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterTrialUserResponse, error)

	RegisterTrialUserWithResponse(ctx context.Context, body RegisterTrialUserJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisterTrialUserResponse, error)
}

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

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RegisterTrialUserJSONBody

type RegisterTrialUserJSONBody TrialRequest

RegisterTrialUserJSONBody defines parameters for RegisterTrialUser.

type RegisterTrialUserJSONRequestBody

type RegisterTrialUserJSONRequestBody RegisterTrialUserJSONBody

RegisterTrialUserJSONRequestBody defines body for RegisterTrialUser for application/json ContentType.

type RegisterTrialUserResponse

type RegisterTrialUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *TrialResponse
	JSON403      *ApiError
	JSON429      *ApiError
	JSON500      *ApiError
}

func ParseRegisterTrialUserResponse

func ParseRegisterTrialUserResponse(rsp *http.Response) (*RegisterTrialUserResponse, error)

ParseRegisterTrialUserResponse parses an HTTP response from a RegisterTrialUserWithResponse call

func (RegisterTrialUserResponse) Status

func (r RegisterTrialUserResponse) Status() string

Status returns HTTPResponse.Status

func (RegisterTrialUserResponse) StatusCode

func (r RegisterTrialUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type TrialRequest

type TrialRequest struct {
	Email openapi_types.Email `json:"email"`
}

TrialRequest defines model for TrialRequest.

type TrialResponse

type TrialResponse struct {
	// The expiry time of the API key
	ExpiresAt *time.Time `json:"expires_at,omitempty"`

	// The ID of the trial registration request created in the system
	Id *string `json:"id,omitempty"`
}

TrialResponse defines model for TrialResponse.

Jump to

Keyboard shortcuts

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