api

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

Code generated by unknown module path version unknown version DO NOT EDIT.

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

Code generated by unknown module path version unknown version DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewGetHealthcheckRequest

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

NewGetHealthcheckRequest generates requests for GetHealthcheck

func NewPostAuthTokenRequest

func NewPostAuthTokenRequest(server string, body PostAuthTokenJSONRequestBody) (*http.Request, error)

NewPostAuthTokenRequest calls the generic PostAuthToken builder with application/json body

func NewPostAuthTokenRequestWithBody

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

NewPostAuthTokenRequestWithBody generates requests for PostAuthToken with any type of body

func NewPostCertificateRenewalRequest

func NewPostCertificateRenewalRequest(server string, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody) (*http.Request, error)

NewPostCertificateRenewalRequest calls the generic PostCertificateRenewal builder with application/json body

func NewPostCertificateRenewalRequestWithBody

func NewPostCertificateRenewalRequestWithBody(server string, isdNumber int, asNumber AS, contentType string, body io.Reader) (*http.Request, error)

NewPostCertificateRenewalRequestWithBody generates requests for PostCertificateRenewal with any type of body

Types

type AS

type AS string

AS defines model for AS.

type AccessCredentials

type AccessCredentials struct {
	// ID of the control service requesting authentication.
	ClientId string `json:"client_id"`

	// Secret that authenticates the control service.
	ClientSecret string `json:"client_secret"`
}

AccessCredentials defines model for AccessCredentials.

type AccessToken

type AccessToken struct {
	// The encoded JWT token
	AccessToken string `json:"access_token"`

	// Validity duration of this token in seconds.
	ExpiresIn int `json:"expires_in"`

	// Type of returned access token. Currently always Bearer.
	TokenType AccessTokenTokenType `json:"token_type"`
}

AccessToken defines model for AccessToken.

type AccessTokenTokenType

type AccessTokenTokenType string

Type of returned access token. Currently always Bearer.

const (
	AccessTokenTokenTypeBearer AccessTokenTokenType = "Bearer"
)

Defines values for AccessTokenTokenType.

type CertificateChain

type CertificateChain struct {
	// Base64 encoded AS certificate.
	AsCertificate []byte `json:"as_certificate"`

	// Base64 encoded CA certificate.
	CaCertificate []byte `json:"ca_certificate"`
}

CertificateChain defines model for CertificateChain.

type CertificateChainPKCS7

type CertificateChainPKCS7 []byte

Certificate chain containing the the new AS certificate and the issuing CA certificate encoded in a degenerate PKCS#7 data structure.

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

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

func (*Client) PostAuthToken

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

func (*Client) PostAuthTokenWithBody

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

func (*Client) PostCertificateRenewal

func (c *Client) PostCertificateRenewal(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostCertificateRenewalWithBody

func (c *Client) PostCertificateRenewalWithBody(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

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

	PostAuthToken(ctx context.Context, body PostAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetHealthcheck request
	GetHealthcheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostCertificateRenewal request with any body
	PostCertificateRenewalWithBody(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostCertificateRenewal(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, 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) GetHealthcheckWithResponse

func (c *ClientWithResponses) GetHealthcheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthcheckResponse, error)

GetHealthcheckWithResponse request returning *GetHealthcheckResponse

func (*ClientWithResponses) PostAuthTokenWithBodyWithResponse

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

PostAuthTokenWithBodyWithResponse request with arbitrary body returning *PostAuthTokenResponse

func (*ClientWithResponses) PostAuthTokenWithResponse

func (c *ClientWithResponses) PostAuthTokenWithResponse(ctx context.Context, body PostAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthTokenResponse, error)

func (*ClientWithResponses) PostCertificateRenewalWithBodyWithResponse

func (c *ClientWithResponses) PostCertificateRenewalWithBodyWithResponse(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error)

PostCertificateRenewalWithBodyWithResponse request with arbitrary body returning *PostCertificateRenewalResponse

func (*ClientWithResponses) PostCertificateRenewalWithResponse

func (c *ClientWithResponses) PostCertificateRenewalWithResponse(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error)

type ClientWithResponsesInterface

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

	PostAuthTokenWithResponse(ctx context.Context, body PostAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthTokenResponse, error)

	// GetHealthcheck request
	GetHealthcheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthcheckResponse, error)

	// PostCertificateRenewal request with any body
	PostCertificateRenewalWithBodyWithResponse(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error)

	PostCertificateRenewalWithResponse(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error)
}

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

type GetHealthcheckResponse

type GetHealthcheckResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *HealthCheckStatus
}

func ParseGetHealthcheckResponse

func ParseGetHealthcheckResponse(rsp *http.Response) (*GetHealthcheckResponse, error)

ParseGetHealthcheckResponse parses an HTTP response from a GetHealthcheckWithResponse call

func (GetHealthcheckResponse) Status

func (r GetHealthcheckResponse) Status() string

Status returns HTTPResponse.Status

func (GetHealthcheckResponse) StatusCode

func (r GetHealthcheckResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HealthCheckStatus

type HealthCheckStatus struct {
	Status HealthCheckStatusStatus `json:"status"`
}

HealthCheckStatus defines model for HealthCheckStatus.

type HealthCheckStatusStatus

type HealthCheckStatusStatus string

HealthCheckStatusStatus defines model for HealthCheckStatus.Status.

const (
	HealthCheckStatusStatusAvailable HealthCheckStatusStatus = "available"

	HealthCheckStatusStatusStarting HealthCheckStatusStatus = "starting"

	HealthCheckStatusStatusStopping HealthCheckStatusStatus = "stopping"

	HealthCheckStatusStatusUnavailable HealthCheckStatusStatus = "unavailable"
)

Defines values for HealthCheckStatusStatus.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostAuthTokenJSONBody

type PostAuthTokenJSONBody AccessCredentials

PostAuthTokenJSONBody defines parameters for PostAuthToken.

type PostAuthTokenJSONRequestBody

type PostAuthTokenJSONRequestBody PostAuthTokenJSONBody

PostAuthTokenJSONRequestBody defines body for PostAuthToken for application/json ContentType.

type PostAuthTokenResponse

type PostAuthTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AccessToken
}

func ParsePostAuthTokenResponse

func ParsePostAuthTokenResponse(rsp *http.Response) (*PostAuthTokenResponse, error)

ParsePostAuthTokenResponse parses an HTTP response from a PostAuthTokenWithResponse call

func (PostAuthTokenResponse) Status

func (r PostAuthTokenResponse) Status() string

Status returns HTTPResponse.Status

func (PostAuthTokenResponse) StatusCode

func (r PostAuthTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostCertificateRenewalJSONBody

type PostCertificateRenewalJSONBody RenewalRequest

PostCertificateRenewalJSONBody defines parameters for PostCertificateRenewal.

type PostCertificateRenewalJSONRequestBody

type PostCertificateRenewalJSONRequestBody PostCertificateRenewalJSONBody

PostCertificateRenewalJSONRequestBody defines body for PostCertificateRenewal for application/json ContentType.

type PostCertificateRenewalResponse

type PostCertificateRenewalResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RenewalResponse
}

func ParsePostCertificateRenewalResponse

func ParsePostCertificateRenewalResponse(rsp *http.Response) (*PostCertificateRenewalResponse, error)

ParsePostCertificateRenewalResponse parses an HTTP response from a PostCertificateRenewalWithResponse call

func (PostCertificateRenewalResponse) Status

Status returns HTTPResponse.Status

func (PostCertificateRenewalResponse) StatusCode

func (r PostCertificateRenewalResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Problem

type Problem struct {
	// Identifier to correlate multiple error messages to the same case.
	CorrelationId *string `json:"correlation_id,omitempty"`

	// A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Detail *string `json:"detail,omitempty"`

	// A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type.
	Instance *string `json:"instance,omitempty"`

	// The HTTP status code generated by the server for this occurrence of the problem.
	Status int `json:"status"`

	// A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Title string `json:"title"`

	// A URI reference that uniquely identifies the problem type in the context of the provided API.
	Type string `json:"type"`
}

Error message encoded as specified in [RFC7807](https://tools.ietf.org/html/rfc7807)

type RenewalRequest

type RenewalRequest struct {
	// Base64 encoded renewal request as described below.
	//
	// The renewal requests consists of a CMS SignedData structure that
	// contains a PKCS#10 defining the parameters of the requested
	// certificate.
	//
	// The following must hold for the CMS structure:
	//
	// - The `certificates` field in `SignedData` MUST contain an existing
	//   and verifiable certificate chain that authenticates the private
	//   key that was used to sign the CMS structure. It MUST NOT contain
	//   any other certificates.
	//
	// - The `eContentType` is set to `id-data`. The contents of `eContent`
	//   is the ASN.1 DER encoded PKCS#10. This ensures backwards
	//   compatibility with PKCS#7, as described in
	//   [RFC5652](https://tools.ietf.org/html/rfc5652#section-5.2.1)
	//
	// - The `SignerIdentifier` MUST be the choice `IssuerAndSerialNumber`,
	//   thus, `version` in `SignerInfo` must be 1, as required by
	//   [RFC5652](https://tools.ietf.org/html/rfc5652#section-5.3)
	Csr []byte `json:"csr"`
}

RenewalRequest defines model for RenewalRequest.

type RenewalResponse

type RenewalResponse struct {
	CertificateChain interface{} `json:"certificate_chain"`
}

RenewalResponse defines model for RenewalResponse.

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