Documentation
¶
Overview ¶
Package apigen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Index ¶
- func NewGetDeployRequest(server string, serviceId string, deployId string) (*http.Request, error)
- func NewGetServiceRequest(server string, serviceId string) (*http.Request, error)
- func NewListDeploysRequest(server string, serviceId string) (*http.Request, error)
- func NewListServicesRequest(server string) (*http.Request, error)
- type Client
- func (c *Client) GetDeploy(ctx context.Context, serviceId string, deployId string, ...) (*http.Response, error)
- func (c *Client) GetService(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListDeploys(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListServices(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetDeployWithResponse(ctx context.Context, serviceId string, deployId string, ...) (*GetDeployResponse, error)
- func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*GetServiceResponse, error)
- func (c *ClientWithResponses) ListDeploysWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*ListDeploysResponse, error)
- func (c *ClientWithResponses) ListServicesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListServicesResponse, error)
- type ClientWithResponsesInterface
- type Deploy
- type DeployStatus
- type GetDeployResponse
- type GetServiceResponse
- type HttpRequestDoer
- type ListDeploysResponse
- type ListServicesResponse
- type RequestEditorFn
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetDeployRequest ¶
NewGetDeployRequest generates requests for GetDeploy
func NewGetServiceRequest ¶
NewGetServiceRequest generates requests for GetService
func NewListDeploysRequest ¶
NewListDeploysRequest generates requests for ListDeploys
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) GetService ¶
func (*Client) ListDeploys ¶
func (*Client) ListServices ¶
type ClientInterface ¶
type ClientInterface interface { // ListServices request ListServices(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // GetService request GetService(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDeploys request ListDeploys(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDeploy request GetDeploy(ctx context.Context, serviceId string, deployId string, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
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) GetDeployWithResponse ¶
func (c *ClientWithResponses) GetDeployWithResponse(ctx context.Context, serviceId string, deployId string, reqEditors ...RequestEditorFn) (*GetDeployResponse, error)
GetDeployWithResponse request returning *GetDeployResponse
func (*ClientWithResponses) GetServiceWithResponse ¶
func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*GetServiceResponse, error)
GetServiceWithResponse request returning *GetServiceResponse
func (*ClientWithResponses) ListDeploysWithResponse ¶
func (c *ClientWithResponses) ListDeploysWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*ListDeploysResponse, error)
ListDeploysWithResponse request returning *ListDeploysResponse
func (*ClientWithResponses) ListServicesWithResponse ¶
func (c *ClientWithResponses) ListServicesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListServicesResponse, error)
ListServicesWithResponse request returning *ListServicesResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // ListServices request ListServicesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListServicesResponse, error) // GetService request GetServiceWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) // ListDeploys request ListDeploysWithResponse(ctx context.Context, serviceId string, reqEditors ...RequestEditorFn) (*ListDeploysResponse, error) // GetDeploy request GetDeployWithResponse(ctx context.Context, serviceId string, deployId string, reqEditors ...RequestEditorFn) (*GetDeployResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Deploy ¶
type Deploy struct { Commit *struct { CreatedAt time.Time `json:"createdAt"` Id string `json:"id"` Message string `json:"message"` } `json:"commit,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty"` Id string `json:"id"` Status *DeployStatus `json:"status,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` }
Deploy defines model for Deploy.
type DeployStatus ¶
type DeployStatus string
DeployStatus defines model for Deploy.Status.
const ( BuildFailed DeployStatus = "build_failed" BuildInProgress DeployStatus = "build_in_progress" Canceled DeployStatus = "canceled" Created DeployStatus = "created" Deactivated DeployStatus = "deactivated" Live DeployStatus = "live" UpdateFailed DeployStatus = "update_failed" UpdateInProgress DeployStatus = "update_in_progress" )
Defines values for DeployStatus.
type GetDeployResponse ¶
func ParseGetDeployResponse ¶
func ParseGetDeployResponse(rsp *http.Response) (*GetDeployResponse, error)
ParseGetDeployResponse parses an HTTP response from a GetDeployWithResponse call
func (GetDeployResponse) Status ¶
func (r GetDeployResponse) Status() string
Status returns HTTPResponse.Status
func (GetDeployResponse) StatusCode ¶
func (r GetDeployResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetServiceResponse ¶
func ParseGetServiceResponse ¶
func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error)
ParseGetServiceResponse parses an HTTP response from a GetServiceWithResponse call
func (GetServiceResponse) Status ¶
func (r GetServiceResponse) Status() string
Status returns HTTPResponse.Status
func (GetServiceResponse) StatusCode ¶
func (r GetServiceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListDeploysResponse ¶
type ListDeploysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]struct { Deploy Deploy `json:"deploy"` } }
func ParseListDeploysResponse ¶
func ParseListDeploysResponse(rsp *http.Response) (*ListDeploysResponse, error)
ParseListDeploysResponse parses an HTTP response from a ListDeploysWithResponse call
func (ListDeploysResponse) Status ¶
func (r ListDeploysResponse) Status() string
Status returns HTTPResponse.Status
func (ListDeploysResponse) StatusCode ¶
func (r ListDeploysResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListServicesResponse ¶
type ListServicesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]struct { Service Service `json:"service"` } }
func ParseListServicesResponse ¶
func ParseListServicesResponse(rsp *http.Response) (*ListServicesResponse, error)
ParseListServicesResponse parses an HTTP response from a ListServicesWithResponse call
func (ListServicesResponse) Status ¶
func (r ListServicesResponse) Status() string
Status returns HTTPResponse.Status
func (ListServicesResponse) StatusCode ¶
func (r ListServicesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Service ¶
type Service struct { AutoDeploy string `json:"autoDeploy"` Branch string `json:"branch"` CreatedAt time.Time `json:"createdAt"` Id string `json:"id"` Name string `json:"name"` Repo string `json:"repo"` Slug string `json:"slug"` UpdatedAt time.Time `json:"updatedAt"` }
Service defines model for Service.