api

package
v0.0.0-...-3baaf17 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeleteProjectRequest

func NewDeleteProjectRequest(server string, projectId string) (*http.Request, error)

NewDeleteProjectRequest generates requests for DeleteProject

func NewDeleteProjectsProjectIdDatabasesNameRequest

func NewDeleteProjectsProjectIdDatabasesNameRequest(server string, projectId string, name string) (*http.Request, error)

NewDeleteProjectsProjectIdDatabasesNameRequest generates requests for DeleteProjectsProjectIdDatabasesName

func NewGetProjectsProjectIdDatabasesNameRequest

func NewGetProjectsProjectIdDatabasesNameRequest(server string, projectId string, name string) (*http.Request, error)

NewGetProjectsProjectIdDatabasesNameRequest generates requests for GetProjectsProjectIdDatabasesName

func NewGetProjectsProjectIdDatabasesRequest

func NewGetProjectsProjectIdDatabasesRequest(server string, projectId string) (*http.Request, error)

NewGetProjectsProjectIdDatabasesRequest generates requests for GetProjectsProjectIdDatabases

func NewGetProjectsProjectIdRequest

func NewGetProjectsProjectIdRequest(server string, projectId string) (*http.Request, error)

NewGetProjectsProjectIdRequest generates requests for GetProjectsProjectId

func NewGetProjectsRequest

func NewGetProjectsRequest(server string, params *GetProjectsParams) (*http.Request, error)

NewGetProjectsRequest generates requests for GetProjects

func NewPostProjectsProjectIdDatabasesRequest

func NewPostProjectsProjectIdDatabasesRequest(server string, projectId string, body PostProjectsProjectIdDatabasesJSONRequestBody) (*http.Request, error)

NewPostProjectsProjectIdDatabasesRequest calls the generic PostProjectsProjectIdDatabases builder with application/json body

func NewPostProjectsProjectIdDatabasesRequestWithBody

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

NewPostProjectsProjectIdDatabasesRequestWithBody generates requests for PostProjectsProjectIdDatabases with any type of body

func NewPostProjectsRequest

func NewPostProjectsRequest(server string, body PostProjectsJSONRequestBody) (*http.Request, error)

NewPostProjectsRequest calls the generic PostProjects builder with application/json body

func NewPostProjectsRequestWithBody

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

NewPostProjectsRequestWithBody generates requests for PostProjects with any type of body

Types

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

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

func (*Client) DeleteProjectsProjectIdDatabasesName

func (c *Client) DeleteProjectsProjectIdDatabasesName(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetProjects

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

func (*Client) GetProjectsProjectId

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

func (*Client) GetProjectsProjectIdDatabases

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

func (*Client) GetProjectsProjectIdDatabasesName

func (c *Client) GetProjectsProjectIdDatabasesName(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostProjects

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

func (*Client) PostProjectsProjectIdDatabases

func (c *Client) PostProjectsProjectIdDatabases(ctx context.Context, projectId string, body PostProjectsProjectIdDatabasesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostProjectsProjectIdDatabasesWithBody

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

func (*Client) PostProjectsWithBody

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

type ClientInterface

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

	// PostProjectsWithBody request with any body
	PostProjectsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostProjects(ctx context.Context, body PostProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

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

	// PostProjectsProjectIdDatabasesWithBody request with any body
	PostProjectsProjectIdDatabasesWithBody(ctx context.Context, projectId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostProjectsProjectIdDatabases(ctx context.Context, projectId string, body PostProjectsProjectIdDatabasesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteProjectsProjectIdDatabasesName request
	DeleteProjectsProjectIdDatabasesName(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetProjectsProjectIdDatabasesName request
	GetProjectsProjectIdDatabasesName(ctx context.Context, projectId string, name 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) DeleteProjectWithResponse

func (c *ClientWithResponses) DeleteProjectWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*DeleteProjectResponse, error)

DeleteProjectWithResponse request returning *DeleteProjectResponse

func (*ClientWithResponses) DeleteProjectsProjectIdDatabasesNameWithResponse

func (c *ClientWithResponses) DeleteProjectsProjectIdDatabasesNameWithResponse(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*DeleteProjectsProjectIdDatabasesNameResponse, error)

DeleteProjectsProjectIdDatabasesNameWithResponse request returning *DeleteProjectsProjectIdDatabasesNameResponse

func (*ClientWithResponses) GetProjectsProjectIdDatabasesNameWithResponse

func (c *ClientWithResponses) GetProjectsProjectIdDatabasesNameWithResponse(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdDatabasesNameResponse, error)

GetProjectsProjectIdDatabasesNameWithResponse request returning *GetProjectsProjectIdDatabasesNameResponse

func (*ClientWithResponses) GetProjectsProjectIdDatabasesWithResponse

func (c *ClientWithResponses) GetProjectsProjectIdDatabasesWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdDatabasesResponse, error)

GetProjectsProjectIdDatabasesWithResponse request returning *GetProjectsProjectIdDatabasesResponse

func (*ClientWithResponses) GetProjectsProjectIdWithResponse

func (c *ClientWithResponses) GetProjectsProjectIdWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdResponse, error)

GetProjectsProjectIdWithResponse request returning *GetProjectsProjectIdResponse

func (*ClientWithResponses) GetProjectsWithResponse

func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, params *GetProjectsParams, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error)

GetProjectsWithResponse request returning *GetProjectsResponse

func (*ClientWithResponses) PostProjectsProjectIdDatabasesWithBodyWithResponse

func (c *ClientWithResponses) PostProjectsProjectIdDatabasesWithBodyWithResponse(ctx context.Context, projectId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProjectsProjectIdDatabasesResponse, error)

PostProjectsProjectIdDatabasesWithBodyWithResponse request with arbitrary body returning *PostProjectsProjectIdDatabasesResponse

func (*ClientWithResponses) PostProjectsProjectIdDatabasesWithResponse

func (c *ClientWithResponses) PostProjectsProjectIdDatabasesWithResponse(ctx context.Context, projectId string, body PostProjectsProjectIdDatabasesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProjectsProjectIdDatabasesResponse, error)

func (*ClientWithResponses) PostProjectsWithBodyWithResponse

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

PostProjectsWithBodyWithResponse request with arbitrary body returning *PostProjectsResponse

func (*ClientWithResponses) PostProjectsWithResponse

func (c *ClientWithResponses) PostProjectsWithResponse(ctx context.Context, body PostProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProjectsResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetProjectsWithResponse request
	GetProjectsWithResponse(ctx context.Context, params *GetProjectsParams, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error)

	// PostProjectsWithBodyWithResponse request with any body
	PostProjectsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProjectsResponse, error)

	PostProjectsWithResponse(ctx context.Context, body PostProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProjectsResponse, error)

	// DeleteProjectWithResponse request
	DeleteProjectWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*DeleteProjectResponse, error)

	// GetProjectsProjectIdWithResponse request
	GetProjectsProjectIdWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdResponse, error)

	// GetProjectsProjectIdDatabasesWithResponse request
	GetProjectsProjectIdDatabasesWithResponse(ctx context.Context, projectId string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdDatabasesResponse, error)

	// PostProjectsProjectIdDatabasesWithBodyWithResponse request with any body
	PostProjectsProjectIdDatabasesWithBodyWithResponse(ctx context.Context, projectId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProjectsProjectIdDatabasesResponse, error)

	PostProjectsProjectIdDatabasesWithResponse(ctx context.Context, projectId string, body PostProjectsProjectIdDatabasesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProjectsProjectIdDatabasesResponse, error)

	// DeleteProjectsProjectIdDatabasesNameWithResponse request
	DeleteProjectsProjectIdDatabasesNameWithResponse(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*DeleteProjectsProjectIdDatabasesNameResponse, error)

	// GetProjectsProjectIdDatabasesNameWithResponse request
	GetProjectsProjectIdDatabasesNameWithResponse(ctx context.Context, projectId string, name string, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdDatabasesNameResponse, error)
}

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

type CreateDatabaseRequest

type CreateDatabaseRequest struct {
	// Name Name of the database instance
	Name string `json:"name"`
}

CreateDatabaseRequest defines model for CreateDatabaseRequest.

type CreateProjectRequest

type CreateProjectRequest struct {
	// BackupLocation S3 URL of the backup file (e.g., s3://bucket/path/to/backup.dump)
	BackupLocation *string      `json:"backupLocation,omitempty"`
	DbType         DatabaseType `json:"dbType"`

	// DbVersion Version of the database (e.g., '15.3' for PostgreSQL)
	DbVersion string `json:"dbVersion"`

	// Name Name of the project
	Name string `json:"name"`

	// Owner Owner of the project
	Owner string `json:"owner"`
}

CreateProjectRequest defines model for CreateProjectRequest.

type Database

type Database struct {
	Database *string        `json:"database,omitempty"`
	Host     *string        `json:"host,omitempty"`
	Name     string         `json:"name"`
	Port     *int           `json:"port,omitempty"`
	Project  *string        `json:"project,omitempty"`
	Status   DatabaseStatus `json:"status"`
	Username *string        `json:"username,omitempty"`
}

Database defines model for Database.

type DatabaseStatus

type DatabaseStatus string

DatabaseStatus defines model for Database.Status.

const (
	Creating DatabaseStatus = "creating"
	Error    DatabaseStatus = "error"
	Running  DatabaseStatus = "running"
	Stopped  DatabaseStatus = "stopped"
)

Defines values for DatabaseStatus.

type DatabaseType

type DatabaseType string

DatabaseType defines model for DatabaseType.

const (
	Postgres DatabaseType = "postgres"
)

Defines values for DatabaseType.

type DefaultDatabaseCredentials

type DefaultDatabaseCredentials struct {
	// Database Default database name
	Database string `json:"database"`

	// Password Default password for database access
	Password string `json:"password"`

	// Username Default username for database access
	Username string `json:"username"`
}

DefaultDatabaseCredentials defines model for DefaultDatabaseCredentials.

type DeleteProjectResponse

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

func ParseDeleteProjectResponse

func ParseDeleteProjectResponse(rsp *http.Response) (*DeleteProjectResponse, error)

ParseDeleteProjectResponse parses an HTTP response from a DeleteProjectWithResponse call

func (DeleteProjectResponse) Status

func (r DeleteProjectResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteProjectResponse) StatusCode

func (r DeleteProjectResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteProjectsProjectIdDatabasesNameResponse

type DeleteProjectsProjectIdDatabasesNameResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Message *string `json:"message,omitempty"`
	}
}

func ParseDeleteProjectsProjectIdDatabasesNameResponse

func ParseDeleteProjectsProjectIdDatabasesNameResponse(rsp *http.Response) (*DeleteProjectsProjectIdDatabasesNameResponse, error)

ParseDeleteProjectsProjectIdDatabasesNameResponse parses an HTTP response from a DeleteProjectsProjectIdDatabasesNameWithResponse call

func (DeleteProjectsProjectIdDatabasesNameResponse) Status

Status returns HTTPResponse.Status

func (DeleteProjectsProjectIdDatabasesNameResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetProjectsParams

type GetProjectsParams struct {
	Owner *string `form:"owner,omitempty" json:"owner,omitempty"`
}

GetProjectsParams defines parameters for GetProjects.

type GetProjectsProjectIdDatabasesNameResponse

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

func ParseGetProjectsProjectIdDatabasesNameResponse

func ParseGetProjectsProjectIdDatabasesNameResponse(rsp *http.Response) (*GetProjectsProjectIdDatabasesNameResponse, error)

ParseGetProjectsProjectIdDatabasesNameResponse parses an HTTP response from a GetProjectsProjectIdDatabasesNameWithResponse call

func (GetProjectsProjectIdDatabasesNameResponse) Status

Status returns HTTPResponse.Status

func (GetProjectsProjectIdDatabasesNameResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetProjectsProjectIdDatabasesResponse

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

func ParseGetProjectsProjectIdDatabasesResponse

func ParseGetProjectsProjectIdDatabasesResponse(rsp *http.Response) (*GetProjectsProjectIdDatabasesResponse, error)

ParseGetProjectsProjectIdDatabasesResponse parses an HTTP response from a GetProjectsProjectIdDatabasesWithResponse call

func (GetProjectsProjectIdDatabasesResponse) Status

Status returns HTTPResponse.Status

func (GetProjectsProjectIdDatabasesResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetProjectsProjectIdResponse

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

func ParseGetProjectsProjectIdResponse

func ParseGetProjectsProjectIdResponse(rsp *http.Response) (*GetProjectsProjectIdResponse, error)

ParseGetProjectsProjectIdResponse parses an HTTP response from a GetProjectsProjectIdWithResponse call

func (GetProjectsProjectIdResponse) Status

Status returns HTTPResponse.Status

func (GetProjectsProjectIdResponse) StatusCode

func (r GetProjectsProjectIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetProjectsResponse

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

func ParseGetProjectsResponse

func ParseGetProjectsResponse(rsp *http.Response) (*GetProjectsResponse, error)

ParseGetProjectsResponse parses an HTTP response from a GetProjectsWithResponse call

func (GetProjectsResponse) Status

func (r GetProjectsResponse) Status() string

Status returns HTTPResponse.Status

func (GetProjectsResponse) StatusCode

func (r GetProjectsResponse) 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 PostProjectsJSONRequestBody

type PostProjectsJSONRequestBody = CreateProjectRequest

PostProjectsJSONRequestBody defines body for PostProjects for application/json ContentType.

type PostProjectsProjectIdDatabasesJSONRequestBody

type PostProjectsProjectIdDatabasesJSONRequestBody = CreateDatabaseRequest

PostProjectsProjectIdDatabasesJSONRequestBody defines body for PostProjectsProjectIdDatabases for application/json ContentType.

type PostProjectsProjectIdDatabasesResponse

type PostProjectsProjectIdDatabasesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Database
}

func ParsePostProjectsProjectIdDatabasesResponse

func ParsePostProjectsProjectIdDatabasesResponse(rsp *http.Response) (*PostProjectsProjectIdDatabasesResponse, error)

ParsePostProjectsProjectIdDatabasesResponse parses an HTTP response from a PostProjectsProjectIdDatabasesWithResponse call

func (PostProjectsProjectIdDatabasesResponse) Status

Status returns HTTPResponse.Status

func (PostProjectsProjectIdDatabasesResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type PostProjectsResponse

type PostProjectsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Project
}

func ParsePostProjectsResponse

func ParsePostProjectsResponse(rsp *http.Response) (*PostProjectsResponse, error)

ParsePostProjectsResponse parses an HTTP response from a PostProjectsWithResponse call

func (PostProjectsResponse) Status

func (r PostProjectsResponse) Status() string

Status returns HTTPResponse.Status

func (PostProjectsResponse) StatusCode

func (r PostProjectsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Project

type Project struct {
	// BackupLocation S3 URL where the database backup (pg_dump output) is stored
	BackupLocation     string                     `json:"backupLocation"`
	Databases          *[]Database                `json:"databases,omitempty"`
	DbType             DatabaseType               `json:"dbType"`
	DbVersion          string                     `json:"dbVersion"`
	DefaultCredentials DefaultDatabaseCredentials `json:"defaultCredentials"`
	Id                 string                     `json:"id"`
	Name               string                     `json:"name"`
	Owner              string                     `json:"owner"`
}

Project defines model for Project.

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