instances

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Code generated by github.com/do87/oapi-codegen version v0.5.1 DO NOT EDIT.

Index

Constants

View Source
const (
	// Instance status options
	STATUS_READY      = "READY"
	STATUS_FAILED     = "FAILED"
	STATUS_PROCESSING = "PROCESSING"
	STATUS_UNKNOWN    = "UNKNOWN"
)

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(ctx context.Context, server string, projectID string, body CreateJSONRequestBody) (*http.Request, error)

NewCreateRequest calls the generic Create builder with application/json body

func NewCreateRequestWithBody

func NewCreateRequestWithBody(ctx context.Context, server string, projectID string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRequestWithBody generates requests for Create with any type of body

func NewDeleteRequest

func NewDeleteRequest(ctx context.Context, server string, projectID string, instanceID string) (*http.Request, error)

NewDeleteRequest generates requests for Delete

func NewGetRequest

func NewGetRequest(ctx context.Context, server string, projectID string, instanceID InstanceId) (*http.Request, error)

NewGetRequest generates requests for Get

func NewListRequest

func NewListRequest(ctx context.Context, server string, projectID string) (*http.Request, error)

NewListRequest generates requests for List

func NewUpdateRequest

func NewUpdateRequest(ctx context.Context, server string, projectID string, instanceID string, body UpdateJSONRequestBody) (*http.Request, error)

NewUpdateRequest calls the generic Update builder with application/json body

func NewUpdateRequestWithBody

func NewUpdateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRequestWithBody generates requests for Update with any type of body

Types

type BadRequest

type BadRequest = Error

BadRequest defines model for BadRequest.

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 common.Client
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, httpClient common.Client) *Client

Creates a new Client, with reasonable defaults

func (*Client) Create

func (c *Client) Create(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateWithBody

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

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, projectID string, instanceID InstanceId, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) List

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

func (*Client) Update

func (c *Client) Update(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateWithBody

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

type ClientInterface

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

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

	Create(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Delete request
	Delete(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Get request
	Get(ctx context.Context, projectID string, instanceID InstanceId, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	Update(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, httpClient common.Client) *ClientWithResponses

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateWithBodyWithResponse

func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithBodyWithResponse request with arbitrary body returning *CreateResponse

func (*ClientWithResponses) CreateWithResponse

func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

func (*ClientWithResponses) DeleteWithResponse

func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

DeleteWithResponse request returning *DeleteResponse

func (*ClientWithResponses) GetWithResponse

func (c *ClientWithResponses) GetWithResponse(ctx context.Context, projectID string, instanceID InstanceId, reqEditors ...RequestEditorFn) (*GetResponse, error)

GetWithResponse request returning *GetResponse

func (*ClientWithResponses) ListWithResponse

func (c *ClientWithResponses) ListWithResponse(ctx context.Context, projectID string, reqEditors ...RequestEditorFn) (*ListResponse, error)

ListWithResponse request returning *ListResponse

func (*ClientWithResponses) ParseCreateResponse

func (c *ClientWithResponses) ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)

ParseCreateResponse parses an HTTP response from a CreateWithResponse call

func (*ClientWithResponses) ParseDeleteResponse

func (c *ClientWithResponses) ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)

ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call

func (*ClientWithResponses) ParseGetResponse

func (c *ClientWithResponses) ParseGetResponse(rsp *http.Response) (*GetResponse, error)

ParseGetResponse parses an HTTP response from a GetWithResponse call

func (*ClientWithResponses) ParseListResponse

func (c *ClientWithResponses) ParseListResponse(rsp *http.Response) (*ListResponse, error)

ParseListResponse parses an HTTP response from a ListWithResponse call

func (*ClientWithResponses) ParseUpdateResponse

func (c *ClientWithResponses) ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)

ParseUpdateResponse parses an HTTP response from a UpdateWithResponse call

func (*ClientWithResponses) UpdateWithBodyWithResponse

func (c *ClientWithResponses) UpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

UpdateWithBodyWithResponse request with arbitrary body returning *UpdateResponse

func (*ClientWithResponses) UpdateWithResponse

func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// List request
	ListWithResponse(ctx context.Context, projectID string, reqEditors ...RequestEditorFn) (*ListResponse, error)

	// Create request with any body
	CreateWithBodyWithResponse(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	CreateWithResponse(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	// Delete request
	DeleteWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

	// Get request
	GetWithResponse(ctx context.Context, projectID string, instanceID InstanceId, reqEditors ...RequestEditorFn) (*GetResponse, error)

	// Update request with any body
	UpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	UpdateWithResponse(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
}

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

type CreateJSONRequestBody

type CreateJSONRequestBody = InstanceProvisionRequest

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *InstanceID
	JSON400      *Error
	JSON409      *Error
	HasError     error // Aggregated error
}

func (CreateResponse) Status

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (CreateResponse) WaitHandler

func (r CreateResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance creation to complete returned interface is of *instance.InstanceSingleInstance

type DeleteResponse

type DeleteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON404      *Error
	HasError     error // Aggregated error
}

func (DeleteResponse) Status

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (DeleteResponse) WaitHandler

func (r DeleteResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance deletion returned value for deletion wait will always be nil

type Error

type Error struct {
	Description string `json:"description"`
	Error       string `json:"error"`
}

Error defines model for Error.

type GetResponse

type GetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Instance
	JSON404      *Error
	JSON410      *Error
	HasError     error // Aggregated error
}

func (GetResponse) Status

func (r GetResponse) Status() string

Status returns HTTPResponse.Status

func (GetResponse) StatusCode

func (r GetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Instance

type Instance struct {
	CfGuid           string        `json:"cfGuid"`
	CfSpaceGuid      string        `json:"cfSpaceGuid"`
	DashboardUrl     string        `json:"dashboardUrl"`
	ImageUrl         string        `json:"imageUrl"`
	InstanceID       *string       `json:"instanceId,omitempty"`
	LastOperation    LastOperation `json:"lastOperation"`
	Name             string        `json:"name"`
	OrganizationGuid *string       `json:"organizationGuid,omitempty"`
	Parameters       Object        `json:"parameters"`
	PlanID           string        `json:"planId"`
}

Instance defines model for Instance.

type InstanceID

type InstanceID struct {
	InstanceID string `json:"instanceId"`
}

InstanceID defines model for InstanceID.

type InstanceId

type InstanceId = string

InstanceId defines model for instanceId.

type InstanceList

type InstanceList struct {
	Instances []Instance `json:"instances"`
}

InstanceList defines model for InstanceList.

type InstanceProvisionRequest

type InstanceProvisionRequest struct {
	InstanceName string  `json:"instanceName"`
	Parameters   *Object `json:"parameters,omitempty"`
	PlanID       string  `json:"planId"`
}

InstanceProvisionRequest defines model for InstanceProvisionRequest.

type InstanceUpdateRequest

type InstanceUpdateRequest struct {
	Parameters *Object `json:"parameters,omitempty"`
	PlanID     string  `json:"planId"`
}

InstanceUpdateRequest defines model for InstanceUpdateRequest.

type LastOperation

type LastOperation struct {
	Description string             `json:"description"`
	State       LastOperationState `json:"state"`
	Type        LastOperationType  `json:"type"`
}

LastOperation defines model for lastOperation.

type LastOperationState

type LastOperationState string

LastOperationState defines model for LastOperation.State.

const (
	FAILED      LastOperationState = "failed"
	IN_PROGRESS LastOperationState = "in progress"
	SUCCEEDED   LastOperationState = "succeeded"
)

Defines values for LastOperationState.

type LastOperationType

type LastOperationType string

LastOperationType defines model for LastOperation.Type.

const (
	CREATE LastOperationType = "create"
	DELETE LastOperationType = "delete"
	UPDATE LastOperationType = "update"
)

Defines values for LastOperationType.

type ListResponse

type ListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *InstanceList
	JSON404      *Error
	HasError     error // Aggregated error
}

func (ListResponse) Status

func (r ListResponse) Status() string

Status returns HTTPResponse.Status

func (ListResponse) StatusCode

func (r ListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type NotFound

type NotFound = Error

NotFound defines model for NotFound.

type Object

type Object = map[string]interface{}

Object defines model for Object.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type UpdateJSONRequestBody

type UpdateJSONRequestBody = InstanceUpdateRequest

UpdateJSONRequestBody defines body for Update for application/json ContentType.

type UpdateResponse

type UpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON404      *Error
	HasError     error // Aggregated error
}

func (UpdateResponse) Status

func (r UpdateResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateResponse) StatusCode

func (r UpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (UpdateResponse) WaitHandler

func (r UpdateResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance update to complete returned interface is of *instance.InstanceSingleInstance

Jump to

Keyboard shortcuts

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