api

package
v0.0.0-...-fad4b69 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildRequest

func NewBuildRequest(server string, project string, version string, build int32) (*http.Request, error)

NewBuildRequest generates requests for Build

func NewBuildsRequest

func NewBuildsRequest(server string, project string, version string) (*http.Request, error)

NewBuildsRequest generates requests for Builds

func NewDownloadRequest

func NewDownloadRequest(server string, project string, version string, build int32, download string) (*http.Request, error)

NewDownloadRequest generates requests for Download

func NewFamilyBuildsRequest

func NewFamilyBuildsRequest(server string, project string, family string) (*http.Request, error)

NewFamilyBuildsRequest generates requests for FamilyBuilds

func NewFamilyRequest

func NewFamilyRequest(server string, project string, family string) (*http.Request, error)

NewFamilyRequest generates requests for Family

func NewProjectRequest

func NewProjectRequest(server string, project string) (*http.Request, error)

NewProjectRequest generates requests for Project

func NewProjectsRequest

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

NewProjectsRequest generates requests for Projects

func NewVersionRequest

func NewVersionRequest(server string, project string, version string) (*http.Request, error)

NewVersionRequest generates requests for Version

Types

type BuildResponse

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

func ParseBuildResponse

func ParseBuildResponse(rsp *http.Response) (*BuildResponse, error)

ParseBuildResponse parses an HTTP response from a BuildWithResponse call

func (BuildResponse) Status

func (r BuildResponse) Status() string

Status returns HTTPResponse.Status

func (BuildResponse) StatusCode

func (r BuildResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type BuildsResponse

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

func ParseBuildsResponse

func ParseBuildsResponse(rsp *http.Response) (*BuildsResponse, error)

ParseBuildsResponse parses an HTTP response from a BuildsWithResponse call

func (BuildsResponse) Status

func (r BuildsResponse) Status() string

Status returns HTTPResponse.Status

func (BuildsResponse) StatusCode

func (r BuildsResponse) 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) Build

func (c *Client) Build(ctx context.Context, project string, version string, build int32, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Builds

func (c *Client) Builds(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Download

func (c *Client) Download(ctx context.Context, project string, version string, build int32, download string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Family

func (c *Client) Family(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) FamilyBuilds

func (c *Client) FamilyBuilds(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Project

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

func (*Client) Projects

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

func (*Client) Version

func (c *Client) Version(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Projects request
	Projects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Project request
	Project(ctx context.Context, project string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Family request
	Family(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// FamilyBuilds request
	FamilyBuilds(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Version request
	Version(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Builds request
	Builds(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Build request
	Build(ctx context.Context, project string, version string, build int32, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Download request
	Download(ctx context.Context, project string, version string, build int32, download string, 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) BuildWithResponse

func (c *ClientWithResponses) BuildWithResponse(ctx context.Context, project string, version string, build int32, reqEditors ...RequestEditorFn) (*BuildResponse, error)

BuildWithResponse request returning *BuildResponse

func (*ClientWithResponses) BuildsWithResponse

func (c *ClientWithResponses) BuildsWithResponse(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*BuildsResponse, error)

BuildsWithResponse request returning *BuildsResponse

func (*ClientWithResponses) DownloadWithResponse

func (c *ClientWithResponses) DownloadWithResponse(ctx context.Context, project string, version string, build int32, download string, reqEditors ...RequestEditorFn) (*DownloadResponse, error)

DownloadWithResponse request returning *DownloadResponse

func (*ClientWithResponses) FamilyBuildsWithResponse

func (c *ClientWithResponses) FamilyBuildsWithResponse(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*VersionFamilyBuildsResponse, error)

FamilyBuildsWithResponse request returning *VersionFamilyBuildsResponse

func (*ClientWithResponses) FamilyWithResponse

func (c *ClientWithResponses) FamilyWithResponse(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*VersionFamilyResponse, error)

FamilyWithResponse request returning *VersionFamilyResponse

func (*ClientWithResponses) ProjectWithResponse

func (c *ClientWithResponses) ProjectWithResponse(ctx context.Context, project string, reqEditors ...RequestEditorFn) (*ProjectResponse, error)

ProjectWithResponse request returning *ProjectResponse

func (*ClientWithResponses) ProjectsWithResponse

func (c *ClientWithResponses) ProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ProjectsResponse, error)

ProjectsWithResponse request returning *ProjectsResponse

func (*ClientWithResponses) VersionWithResponse

func (c *ClientWithResponses) VersionWithResponse(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*VersionResponse, error)

VersionWithResponse request returning *VersionResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ProjectsWithResponse request
	ProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ProjectsResponse, error)

	// ProjectWithResponse request
	ProjectWithResponse(ctx context.Context, project string, reqEditors ...RequestEditorFn) (*ProjectResponse, error)

	// FamilyWithResponse request
	FamilyWithResponse(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*VersionFamilyResponse, error)

	// FamilyBuildsWithResponse request
	FamilyBuildsWithResponse(ctx context.Context, project string, family string, reqEditors ...RequestEditorFn) (*VersionFamilyBuildsResponse, error)

	// VersionWithResponse request
	VersionWithResponse(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*VersionResponse, error)

	// BuildsWithResponse request
	BuildsWithResponse(ctx context.Context, project string, version string, reqEditors ...RequestEditorFn) (*BuildsResponse, error)

	// BuildWithResponse request
	BuildWithResponse(ctx context.Context, project string, version string, build int32, reqEditors ...RequestEditorFn) (*BuildResponse, error)

	// DownloadWithResponse request
	DownloadWithResponse(ctx context.Context, project string, version string, build int32, download string, reqEditors ...RequestEditorFn) (*DownloadResponse, error)
}

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

type DownloadResponse

type DownloadResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseDownloadResponse

func ParseDownloadResponse(rsp *http.Response) (*DownloadResponse, error)

ParseDownloadResponse parses an HTTP response from a DownloadWithResponse call

func (DownloadResponse) Status

func (r DownloadResponse) Status() string

Status returns HTTPResponse.Status

func (DownloadResponse) StatusCode

func (r DownloadResponse) 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 ProjectResponse

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

func ParseProjectResponse

func ParseProjectResponse(rsp *http.Response) (*ProjectResponse, error)

ParseProjectResponse parses an HTTP response from a ProjectWithResponse call

func (ProjectResponse) Status

func (r ProjectResponse) Status() string

Status returns HTTPResponse.Status

func (ProjectResponse) StatusCode

func (r ProjectResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProjectsResponse

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

func ParseProjectsResponse

func ParseProjectsResponse(rsp *http.Response) (*ProjectsResponse, error)

ParseProjectsResponse parses an HTTP response from a ProjectsWithResponse call

func (ProjectsResponse) Status

func (r ProjectsResponse) Status() string

Status returns HTTPResponse.Status

func (ProjectsResponse) StatusCode

func (r ProjectsResponse) 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 VersionFamilyBuildsResponse

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

func ParseVersionFamilyBuildsResponse

func ParseVersionFamilyBuildsResponse(rsp *http.Response) (*VersionFamilyBuildsResponse, error)

ParseVersionFamilyBuildsResponse parses an HTTP response from a FamilyBuildsWithResponse call

func (VersionFamilyBuildsResponse) Status

Status returns HTTPResponse.Status

func (VersionFamilyBuildsResponse) StatusCode

func (r VersionFamilyBuildsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VersionFamilyResponse

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

func ParseVersionFamilyResponse

func ParseVersionFamilyResponse(rsp *http.Response) (*VersionFamilyResponse, error)

ParseVersionFamilyResponse parses an HTTP response from a FamilyWithResponse call

func (VersionFamilyResponse) Status

func (r VersionFamilyResponse) Status() string

Status returns HTTPResponse.Status

func (VersionFamilyResponse) StatusCode

func (r VersionFamilyResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VersionResponse

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

func ParseVersionResponse

func ParseVersionResponse(rsp *http.Response) (*VersionResponse, error)

ParseVersionResponse parses an HTTP response from a VersionWithResponse call

func (VersionResponse) Status

func (r VersionResponse) Status() string

Status returns HTTPResponse.Status

func (VersionResponse) StatusCode

func (r VersionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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