generated

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

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

Variables

This section is empty.

Functions

func NewAuthenticateRequestWithBody

func NewAuthenticateRequestWithBody(server string, params *AuthenticateParams, contentType string, body io.Reader) (*http.Request, error)

NewAuthenticateRequestWithBody generates requests for Authenticate with any type of body

func NewAuthenticateRequestWithFormdataBody

func NewAuthenticateRequestWithFormdataBody(server string, params *AuthenticateParams, body AuthenticateFormdataRequestBody) (*http.Request, error)

NewAuthenticateRequestWithFormdataBody calls the generic Authenticate builder with application/x-www-form-urlencoded body

func NewDownloadFileRequest

func NewDownloadFileRequest(server string, productId int, deliveryId int, fileId int) (*http.Request, error)

NewDownloadFileRequest generates requests for DownloadFile

func NewGetProductRequest

func NewGetProductRequest(server string, productId int) (*http.Request, error)

NewGetProductRequest generates requests for GetProduct

func NewListProductsRequest

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

NewListProductsRequest generates requests for ListProducts

Types

type AuthenticateFormdataBody

type AuthenticateFormdataBody struct {
	// GrantType OAuth2 grant type
	GrantType AuthenticateFormdataBodyGrantType `form:"grant_type" json:"grant_type"`

	// Password EPO BDDS password
	Password string `form:"password" json:"password"`

	// Scope OAuth2 scope
	Scope AuthenticateFormdataBodyScope `form:"scope" json:"scope"`

	// Username EPO BDDS username
	Username string `form:"username" json:"username"`
}

AuthenticateFormdataBody defines parameters for Authenticate.

type AuthenticateFormdataBodyGrantType

type AuthenticateFormdataBodyGrantType string

AuthenticateFormdataBodyGrantType defines parameters for Authenticate.

const (
	Password AuthenticateFormdataBodyGrantType = "password"
)

Defines values for AuthenticateFormdataBodyGrantType.

type AuthenticateFormdataBodyScope

type AuthenticateFormdataBodyScope string

AuthenticateFormdataBodyScope defines parameters for Authenticate.

const (
	Openid AuthenticateFormdataBodyScope = "openid"
)

Defines values for AuthenticateFormdataBodyScope.

type AuthenticateFormdataRequestBody

type AuthenticateFormdataRequestBody AuthenticateFormdataBody

AuthenticateFormdataRequestBody defines body for Authenticate for application/x-www-form-urlencoded ContentType.

type AuthenticateParams

type AuthenticateParams struct {
	// Authorization Basic MG9hM3VwZG43YW41cE1JOE80MTc=
	Authorization string `json:"Authorization"`
}

AuthenticateParams defines parameters for Authenticate.

type AuthenticateResponse

type AuthenticateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TokenResponse
}

func ParseAuthenticateResponse

func ParseAuthenticateResponse(rsp *http.Response) (*AuthenticateResponse, error)

ParseAuthenticateResponse parses an HTTP response from a AuthenticateWithResponse call

func (AuthenticateResponse) Status

func (r AuthenticateResponse) Status() string

Status returns HTTPResponse.Status

func (AuthenticateResponse) StatusCode

func (r AuthenticateResponse) 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) AuthenticateWithBody

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

func (*Client) AuthenticateWithFormdataBody

func (c *Client) AuthenticateWithFormdataBody(ctx context.Context, params *AuthenticateParams, body AuthenticateFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DownloadFile

func (c *Client) DownloadFile(ctx context.Context, productId int, deliveryId int, fileId int, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetProduct

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

func (*Client) ListProducts

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

type ClientInterface

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

	AuthenticateWithFormdataBody(ctx context.Context, params *AuthenticateParams, body AuthenticateFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetProduct request
	GetProduct(ctx context.Context, productId int, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DownloadFile request
	DownloadFile(ctx context.Context, productId int, deliveryId int, fileId int, 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) AuthenticateWithBodyWithResponse

func (c *ClientWithResponses) AuthenticateWithBodyWithResponse(ctx context.Context, params *AuthenticateParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

AuthenticateWithBodyWithResponse request with arbitrary body returning *AuthenticateResponse

func (*ClientWithResponses) AuthenticateWithFormdataBodyWithResponse

func (c *ClientWithResponses) AuthenticateWithFormdataBodyWithResponse(ctx context.Context, params *AuthenticateParams, body AuthenticateFormdataRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

func (*ClientWithResponses) DownloadFileWithResponse

func (c *ClientWithResponses) DownloadFileWithResponse(ctx context.Context, productId int, deliveryId int, fileId int, reqEditors ...RequestEditorFn) (*DownloadFileResponse, error)

DownloadFileWithResponse request returning *DownloadFileResponse

func (*ClientWithResponses) GetProductWithResponse

func (c *ClientWithResponses) GetProductWithResponse(ctx context.Context, productId int, reqEditors ...RequestEditorFn) (*GetProductResponse, error)

GetProductWithResponse request returning *GetProductResponse

func (*ClientWithResponses) ListProductsWithResponse

func (c *ClientWithResponses) ListProductsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListProductsResponse, error)

ListProductsWithResponse request returning *ListProductsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// AuthenticateWithBodyWithResponse request with any body
	AuthenticateWithBodyWithResponse(ctx context.Context, params *AuthenticateParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

	AuthenticateWithFormdataBodyWithResponse(ctx context.Context, params *AuthenticateParams, body AuthenticateFormdataRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

	// ListProductsWithResponse request
	ListProductsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListProductsResponse, error)

	// GetProductWithResponse request
	GetProductWithResponse(ctx context.Context, productId int, reqEditors ...RequestEditorFn) (*GetProductResponse, error)

	// DownloadFileWithResponse request
	DownloadFileWithResponse(ctx context.Context, productId int, deliveryId int, fileId int, reqEditors ...RequestEditorFn) (*DownloadFileResponse, error)
}

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

type Delivery

type Delivery struct {
	// DeliveryExpiryDatetime When the delivery expires (null if no expiry)
	DeliveryExpiryDatetime *time.Time `json:"deliveryExpiryDatetime"`

	// DeliveryId Delivery ID
	DeliveryId int `json:"deliveryId"`

	// DeliveryName Delivery name (typically a date)
	DeliveryName string `json:"deliveryName"`

	// DeliveryPublicationDatetime When the delivery was published
	DeliveryPublicationDatetime time.Time `json:"deliveryPublicationDatetime"`

	// Files Files in this delivery
	Files []DeliveryFile `json:"files"`
}

Delivery defines model for Delivery.

type DeliveryFile

type DeliveryFile struct {
	// FileChecksum File checksum (typically MD5 or SHA)
	FileChecksum string `json:"fileChecksum"`

	// FileId File ID
	FileId int `json:"fileId"`

	// FileName File name
	FileName string `json:"fileName"`

	// FilePublicationDatetime When the file was published
	FilePublicationDatetime time.Time `json:"filePublicationDatetime"`

	// FileSize Human-readable file size
	FileSize string `json:"fileSize"`
}

DeliveryFile defines model for DeliveryFile.

type DownloadFileResponse

type DownloadFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDownloadFileResponse

func ParseDownloadFileResponse(rsp *http.Response) (*DownloadFileResponse, error)

ParseDownloadFileResponse parses an HTTP response from a DownloadFileWithResponse call

func (DownloadFileResponse) Status

func (r DownloadFileResponse) Status() string

Status returns HTTPResponse.Status

func (DownloadFileResponse) StatusCode

func (r DownloadFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetProductResponse

type GetProductResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ProductWithDeliveries
}

func ParseGetProductResponse

func ParseGetProductResponse(rsp *http.Response) (*GetProductResponse, error)

ParseGetProductResponse parses an HTTP response from a GetProductWithResponse call

func (GetProductResponse) Status

func (r GetProductResponse) Status() string

Status returns HTTPResponse.Status

func (GetProductResponse) StatusCode

func (r GetProductResponse) 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 ListProductsResponse

type ListProductsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Product
}

func ParseListProductsResponse

func ParseListProductsResponse(rsp *http.Response) (*ListProductsResponse, error)

ParseListProductsResponse parses an HTTP response from a ListProductsWithResponse call

func (ListProductsResponse) Status

func (r ListProductsResponse) Status() string

Status returns HTTPResponse.Status

func (ListProductsResponse) StatusCode

func (r ListProductsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Product

type Product struct {
	// Description Product description
	Description string `json:"description"`

	// Id Product ID
	Id int `json:"id"`

	// Name Product name
	Name string `json:"name"`
}

Product defines model for Product.

type ProductWithDeliveries

type ProductWithDeliveries struct {
	// Deliveries List of available deliveries for this product
	Deliveries []Delivery `json:"deliveries"`

	// Description Product description
	Description string `json:"description"`

	// Id Product ID
	Id int `json:"id"`

	// Name Product name
	Name string `json:"name"`
}

ProductWithDeliveries defines model for ProductWithDeliveries.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type TokenResponse

type TokenResponse struct {
	// AccessToken JWT access token
	AccessToken string `json:"access_token"`

	// ExpiresIn Token expiry time in seconds (typically 1 hour)
	ExpiresIn int `json:"expires_in"`

	// IdToken OpenID Connect ID token
	IdToken string `json:"id_token"`

	// Scope OAuth2 scope
	Scope string `json:"scope"`

	// TokenType Token type
	TokenType string `json:"token_type"`
}

TokenResponse defines model for TokenResponse.

Jump to

Keyboard shortcuts

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