// Package genesiscloud provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. package genesiscloud import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. // // The standard http.Client implements this interface. type HttpRequestDoer interface { Do(req *http.Request) (*http.Response, error) } // Client which conforms to the OpenAPI3 specification for this service. 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 } // ClientOption allows setting custom parameters during construction type ClientOption func(*Client) error // Creates a new Client, with reasonable defaults func NewClient(server string, opts ...ClientOption) (*Client, error) { // create a client with sane default values client := Client{ Server: server, } // mutate client and add all optional params for _, o := range opts { if err := o(&client); err != nil { return nil, err } } // ensure the server URL always has a trailing slash if !strings.HasSuffix(client.Server, "/") { client.Server += "/" } // create httpClient, if not already present if client.Client == nil { client.Client = &http.Client{} } return &client, nil } // WithHTTPClient allows overriding the default Doer, which is // automatically created using http.Client. This is useful for tests. func WithHTTPClient(doer HttpRequestDoer) ClientOption { return func(c *Client) error { c.Client = doer return nil } } // WithRequestEditorFn allows setting up a callback function, which will be // called right before sending the request. This can be used to mutate the request. func WithRequestEditorFn(fn RequestEditorFn) ClientOption { return func(c *Client) error { c.RequestEditors = append(c.RequestEditors, fn) return nil } } // The interface specification for the client above. type ClientInterface interface { // GetInstancesAvailability request GetInstancesAvailability(ctx context.Context, region Region, params *GetInstancesAvailabilityParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ListFilesystemsPaginated request ListFilesystemsPaginated(ctx context.Context, params *ListFilesystemsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateFilesystemWithBody request with any body CreateFilesystemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateFilesystem(ctx context.Context, body CreateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteFilesystem request DeleteFilesystem(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetFilesystem request GetFilesystem(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateFilesystemWithBody request with any body UpdateFilesystemWithBody(ctx context.Context, filesystemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateFilesystem(ctx context.Context, filesystemId string, body UpdateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListFloatingIPsPaginated request ListFloatingIPsPaginated(ctx context.Context, params *ListFloatingIPsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateFloatingIPWithBody request with any body CreateFloatingIPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateFloatingIP(ctx context.Context, body CreateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteFloatingIP request DeleteFloatingIP(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetFloatingIP request GetFloatingIP(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateFloatingIPWithBody request with any body UpdateFloatingIPWithBody(ctx context.Context, floatingIpId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateFloatingIP(ctx context.Context, floatingIpId string, body UpdateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListImagesPaginated request ListImagesPaginated(ctx context.Context, params *ListImagesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ListInstancesPaginated request ListInstancesPaginated(ctx context.Context, params *ListInstancesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateInstanceWithBody request with any body CreateInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateInstance(ctx context.Context, body CreateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteInstance request DeleteInstance(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInstance request GetInstance(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateInstanceWithBody request with any body UpdateInstanceWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateInstance(ctx context.Context, instanceId string, body UpdateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInstanceActions request GetInstanceActions(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // PerformInstanceActionWithBody request with any body PerformInstanceActionWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PerformInstanceAction(ctx context.Context, instanceId string, body PerformInstanceActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListInstanceSnapshotsPaginated request ListInstanceSnapshotsPaginated(ctx context.Context, instanceId string, params *ListInstanceSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateInstanceSnapshotWithBody request with any body CreateInstanceSnapshotWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateInstanceSnapshot(ctx context.Context, instanceId string, body CreateInstanceSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInstanceUserMetadata request GetInstanceUserMetadata(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetQuotas request GetQuotas(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReservations request GetReservations(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSecurityGroupsPaginated request ListSecurityGroupsPaginated(ctx context.Context, params *ListSecurityGroupsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSecurityGroupWithBody request with any body CreateSecurityGroupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateSecurityGroup(ctx context.Context, body CreateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSecurityGroup request DeleteSecurityGroup(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSecurityGroup request GetSecurityGroup(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateSecurityGroupWithBody request with any body UpdateSecurityGroupWithBody(ctx context.Context, securityGroupId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateSecurityGroup(ctx context.Context, securityGroupId string, body UpdateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSnapshotsPaginated request ListSnapshotsPaginated(ctx context.Context, params *ListSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSnapshotWithBody request with any body CreateSnapshotWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateSnapshot(ctx context.Context, body CreateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSnapshot request DeleteSnapshot(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSnapshot request GetSnapshot(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateSnapshotWithBody request with any body UpdateSnapshotWithBody(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateSnapshot(ctx context.Context, snapshotId string, body UpdateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CloneSnapshotWithBody request with any body CloneSnapshotWithBody(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CloneSnapshot(ctx context.Context, snapshotId string, body CloneSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSSHKeysPaginated request ListSSHKeysPaginated(ctx context.Context, params *ListSSHKeysPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSSHKeyWithBody request with any body CreateSSHKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateSSHKey(ctx context.Context, body CreateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSSHKey request DeleteSSHKey(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSSHKey request GetSSHKey(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateSSHKeyWithBody request with any body UpdateSSHKeyWithBody(ctx context.Context, sshKeyId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateSSHKey(ctx context.Context, sshKeyId string, body UpdateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListVolumesPaginated request ListVolumesPaginated(ctx context.Context, params *ListVolumesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateVolumeWithBody request with any body CreateVolumeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateVolume(ctx context.Context, body CreateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteVolume request DeleteVolume(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetVolume request GetVolume(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateVolumeWithBody request with any body UpdateVolumeWithBody(ctx context.Context, volumeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateVolume(ctx context.Context, volumeId string, body UpdateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) GetInstancesAvailability(ctx context.Context, region Region, params *GetInstancesAvailabilityParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInstancesAvailabilityRequest(c.Server, region, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListFilesystemsPaginated(ctx context.Context, params *ListFilesystemsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListFilesystemsPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateFilesystemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateFilesystemRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateFilesystem(ctx context.Context, body CreateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateFilesystemRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteFilesystem(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteFilesystemRequest(c.Server, filesystemId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetFilesystem(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetFilesystemRequest(c.Server, filesystemId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateFilesystemWithBody(ctx context.Context, filesystemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateFilesystemRequestWithBody(c.Server, filesystemId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateFilesystem(ctx context.Context, filesystemId string, body UpdateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateFilesystemRequest(c.Server, filesystemId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListFloatingIPsPaginated(ctx context.Context, params *ListFloatingIPsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListFloatingIPsPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateFloatingIPWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateFloatingIPRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateFloatingIP(ctx context.Context, body CreateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateFloatingIPRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteFloatingIP(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteFloatingIPRequest(c.Server, floatingIpId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetFloatingIP(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetFloatingIPRequest(c.Server, floatingIpId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateFloatingIPWithBody(ctx context.Context, floatingIpId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateFloatingIPRequestWithBody(c.Server, floatingIpId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateFloatingIP(ctx context.Context, floatingIpId string, body UpdateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateFloatingIPRequest(c.Server, floatingIpId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListImagesPaginated(ctx context.Context, params *ListImagesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListImagesPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListInstancesPaginated(ctx context.Context, params *ListInstancesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListInstancesPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateInstanceRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateInstance(ctx context.Context, body CreateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateInstanceRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteInstance(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteInstanceRequest(c.Server, instanceId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetInstance(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInstanceRequest(c.Server, instanceId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateInstanceWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateInstanceRequestWithBody(c.Server, instanceId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateInstance(ctx context.Context, instanceId string, body UpdateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateInstanceRequest(c.Server, instanceId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetInstanceActions(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInstanceActionsRequest(c.Server, instanceId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) PerformInstanceActionWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPerformInstanceActionRequestWithBody(c.Server, instanceId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) PerformInstanceAction(ctx context.Context, instanceId string, body PerformInstanceActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPerformInstanceActionRequest(c.Server, instanceId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListInstanceSnapshotsPaginated(ctx context.Context, instanceId string, params *ListInstanceSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListInstanceSnapshotsPaginatedRequest(c.Server, instanceId, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateInstanceSnapshotWithBody(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateInstanceSnapshotRequestWithBody(c.Server, instanceId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateInstanceSnapshot(ctx context.Context, instanceId string, body CreateInstanceSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateInstanceSnapshotRequest(c.Server, instanceId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetInstanceUserMetadata(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInstanceUserMetadataRequest(c.Server, instanceId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetQuotas(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetQuotasRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetReservations(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReservationsRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListSecurityGroupsPaginated(ctx context.Context, params *ListSecurityGroupsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSecurityGroupsPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSecurityGroupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSecurityGroupRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSecurityGroup(ctx context.Context, body CreateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSecurityGroupRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteSecurityGroup(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSecurityGroupRequest(c.Server, securityGroupId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetSecurityGroup(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSecurityGroupRequest(c.Server, securityGroupId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSecurityGroupWithBody(ctx context.Context, securityGroupId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSecurityGroupRequestWithBody(c.Server, securityGroupId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSecurityGroup(ctx context.Context, securityGroupId string, body UpdateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSecurityGroupRequest(c.Server, securityGroupId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListSnapshotsPaginated(ctx context.Context, params *ListSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSnapshotsPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSnapshotWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSnapshotRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSnapshot(ctx context.Context, body CreateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSnapshotRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteSnapshot(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSnapshotRequest(c.Server, snapshotId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetSnapshot(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSnapshotRequest(c.Server, snapshotId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSnapshotWithBody(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSnapshotRequestWithBody(c.Server, snapshotId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSnapshot(ctx context.Context, snapshotId string, body UpdateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSnapshotRequest(c.Server, snapshotId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CloneSnapshotWithBody(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCloneSnapshotRequestWithBody(c.Server, snapshotId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CloneSnapshot(ctx context.Context, snapshotId string, body CloneSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCloneSnapshotRequest(c.Server, snapshotId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListSSHKeysPaginated(ctx context.Context, params *ListSSHKeysPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSSHKeysPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSSHKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSSHKeyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateSSHKey(ctx context.Context, body CreateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSSHKeyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteSSHKey(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSSHKeyRequest(c.Server, sshKeyId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetSSHKey(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSSHKeyRequest(c.Server, sshKeyId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSSHKeyWithBody(ctx context.Context, sshKeyId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSSHKeyRequestWithBody(c.Server, sshKeyId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateSSHKey(ctx context.Context, sshKeyId string, body UpdateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateSSHKeyRequest(c.Server, sshKeyId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) ListVolumesPaginated(ctx context.Context, params *ListVolumesPaginatedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListVolumesPaginatedRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateVolumeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateVolumeRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) CreateVolume(ctx context.Context, body CreateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateVolumeRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) DeleteVolume(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteVolumeRequest(c.Server, volumeId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) GetVolume(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetVolumeRequest(c.Server, volumeId) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateVolumeWithBody(ctx context.Context, volumeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateVolumeRequestWithBody(c.Server, volumeId, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } func (c *Client) UpdateVolume(ctx context.Context, volumeId string, body UpdateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateVolumeRequest(c.Server, volumeId, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // NewGetInstancesAvailabilityRequest generates requests for GetInstancesAvailability func NewGetInstancesAvailabilityRequest(server string, region Region, params *GetInstancesAvailabilityParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "region", runtime.ParamLocationPath, region) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/availability/%s/instances", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Placement != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "placement", runtime.ParamLocationQuery, *params.Placement); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListFilesystemsPaginatedRequest generates requests for ListFilesystemsPaginated func NewListFilesystemsPaginatedRequest(server string, params *ListFilesystemsPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/filesystems") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateFilesystemRequest calls the generic CreateFilesystem builder with application/json body func NewCreateFilesystemRequest(server string, body CreateFilesystemJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateFilesystemRequestWithBody(server, "application/json", bodyReader) } // NewCreateFilesystemRequestWithBody generates requests for CreateFilesystem with any type of body func NewCreateFilesystemRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/filesystems") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteFilesystemRequest generates requests for DeleteFilesystem func NewDeleteFilesystemRequest(server string, filesystemId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "filesystem_id", runtime.ParamLocationPath, filesystemId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/filesystems/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetFilesystemRequest generates requests for GetFilesystem func NewGetFilesystemRequest(server string, filesystemId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "filesystem_id", runtime.ParamLocationPath, filesystemId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/filesystems/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateFilesystemRequest calls the generic UpdateFilesystem builder with application/json body func NewUpdateFilesystemRequest(server string, filesystemId string, body UpdateFilesystemJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateFilesystemRequestWithBody(server, filesystemId, "application/json", bodyReader) } // NewUpdateFilesystemRequestWithBody generates requests for UpdateFilesystem with any type of body func NewUpdateFilesystemRequestWithBody(server string, filesystemId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "filesystem_id", runtime.ParamLocationPath, filesystemId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/filesystems/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListFloatingIPsPaginatedRequest generates requests for ListFloatingIPsPaginated func NewListFloatingIPsPaginatedRequest(server string, params *ListFloatingIPsPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/floating-ips") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateFloatingIPRequest calls the generic CreateFloatingIP builder with application/json body func NewCreateFloatingIPRequest(server string, body CreateFloatingIPJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateFloatingIPRequestWithBody(server, "application/json", bodyReader) } // NewCreateFloatingIPRequestWithBody generates requests for CreateFloatingIP with any type of body func NewCreateFloatingIPRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/floating-ips") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteFloatingIPRequest generates requests for DeleteFloatingIP func NewDeleteFloatingIPRequest(server string, floatingIpId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "floating_ip_id", runtime.ParamLocationPath, floatingIpId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/floating-ips/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetFloatingIPRequest generates requests for GetFloatingIP func NewGetFloatingIPRequest(server string, floatingIpId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "floating_ip_id", runtime.ParamLocationPath, floatingIpId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/floating-ips/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateFloatingIPRequest calls the generic UpdateFloatingIP builder with application/json body func NewUpdateFloatingIPRequest(server string, floatingIpId string, body UpdateFloatingIPJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateFloatingIPRequestWithBody(server, floatingIpId, "application/json", bodyReader) } // NewUpdateFloatingIPRequestWithBody generates requests for UpdateFloatingIP with any type of body func NewUpdateFloatingIPRequestWithBody(server string, floatingIpId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "floating_ip_id", runtime.ParamLocationPath, floatingIpId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/floating-ips/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListImagesPaginatedRequest generates requests for ListImagesPaginated func NewListImagesPaginatedRequest(server string, params *ListImagesPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/images") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.Type != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListInstancesPaginatedRequest generates requests for ListInstancesPaginated func NewListInstancesPaginatedRequest(server string, params *ListInstancesPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateInstanceRequest calls the generic CreateInstance builder with application/json body func NewCreateInstanceRequest(server string, body CreateInstanceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateInstanceRequestWithBody(server, "application/json", bodyReader) } // NewCreateInstanceRequestWithBody generates requests for CreateInstance with any type of body func NewCreateInstanceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteInstanceRequest generates requests for DeleteInstance func NewDeleteInstanceRequest(server string, instanceId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetInstanceRequest generates requests for GetInstance func NewGetInstanceRequest(server string, instanceId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateInstanceRequest calls the generic UpdateInstance builder with application/json body func NewUpdateInstanceRequest(server string, instanceId string, body UpdateInstanceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateInstanceRequestWithBody(server, instanceId, "application/json", bodyReader) } // NewUpdateInstanceRequestWithBody generates requests for UpdateInstance with any type of body func NewUpdateInstanceRequestWithBody(server string, instanceId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetInstanceActionsRequest generates requests for GetInstanceActions func NewGetInstanceActionsRequest(server string, instanceId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s/actions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPerformInstanceActionRequest calls the generic PerformInstanceAction builder with application/json body func NewPerformInstanceActionRequest(server string, instanceId string, body PerformInstanceActionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPerformInstanceActionRequestWithBody(server, instanceId, "application/json", bodyReader) } // NewPerformInstanceActionRequestWithBody generates requests for PerformInstanceAction with any type of body func NewPerformInstanceActionRequestWithBody(server string, instanceId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s/actions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListInstanceSnapshotsPaginatedRequest generates requests for ListInstanceSnapshotsPaginated func NewListInstanceSnapshotsPaginatedRequest(server string, instanceId string, params *ListInstanceSnapshotsPaginatedParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s/snapshots", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateInstanceSnapshotRequest calls the generic CreateInstanceSnapshot builder with application/json body func NewCreateInstanceSnapshotRequest(server string, instanceId string, body CreateInstanceSnapshotJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateInstanceSnapshotRequestWithBody(server, instanceId, "application/json", bodyReader) } // NewCreateInstanceSnapshotRequestWithBody generates requests for CreateInstanceSnapshot with any type of body func NewCreateInstanceSnapshotRequestWithBody(server string, instanceId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s/snapshots", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetInstanceUserMetadataRequest generates requests for GetInstanceUserMetadata func NewGetInstanceUserMetadataRequest(server string, instanceId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "instance_id", runtime.ParamLocationPath, instanceId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/instances/%s/user-metadata", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetQuotasRequest generates requests for GetQuotas func NewGetQuotasRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/quotas") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetReservationsRequest generates requests for GetReservations func NewGetReservationsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/reservations") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListSecurityGroupsPaginatedRequest generates requests for ListSecurityGroupsPaginated func NewListSecurityGroupsPaginatedRequest(server string, params *ListSecurityGroupsPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/security-groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateSecurityGroupRequest calls the generic CreateSecurityGroup builder with application/json body func NewCreateSecurityGroupRequest(server string, body CreateSecurityGroupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateSecurityGroupRequestWithBody(server, "application/json", bodyReader) } // NewCreateSecurityGroupRequestWithBody generates requests for CreateSecurityGroup with any type of body func NewCreateSecurityGroupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/security-groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteSecurityGroupRequest generates requests for DeleteSecurityGroup func NewDeleteSecurityGroupRequest(server string, securityGroupId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "security_group_id", runtime.ParamLocationPath, securityGroupId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/security-groups/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetSecurityGroupRequest generates requests for GetSecurityGroup func NewGetSecurityGroupRequest(server string, securityGroupId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "security_group_id", runtime.ParamLocationPath, securityGroupId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/security-groups/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateSecurityGroupRequest calls the generic UpdateSecurityGroup builder with application/json body func NewUpdateSecurityGroupRequest(server string, securityGroupId string, body UpdateSecurityGroupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateSecurityGroupRequestWithBody(server, securityGroupId, "application/json", bodyReader) } // NewUpdateSecurityGroupRequestWithBody generates requests for UpdateSecurityGroup with any type of body func NewUpdateSecurityGroupRequestWithBody(server string, securityGroupId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "security_group_id", runtime.ParamLocationPath, securityGroupId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/security-groups/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListSnapshotsPaginatedRequest generates requests for ListSnapshotsPaginated func NewListSnapshotsPaginatedRequest(server string, params *ListSnapshotsPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateSnapshotRequest calls the generic CreateSnapshot builder with application/json body func NewCreateSnapshotRequest(server string, body CreateSnapshotJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateSnapshotRequestWithBody(server, "application/json", bodyReader) } // NewCreateSnapshotRequestWithBody generates requests for CreateSnapshot with any type of body func NewCreateSnapshotRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteSnapshotRequest generates requests for DeleteSnapshot func NewDeleteSnapshotRequest(server string, snapshotId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "snapshot_id", runtime.ParamLocationPath, snapshotId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetSnapshotRequest generates requests for GetSnapshot func NewGetSnapshotRequest(server string, snapshotId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "snapshot_id", runtime.ParamLocationPath, snapshotId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateSnapshotRequest calls the generic UpdateSnapshot builder with application/json body func NewUpdateSnapshotRequest(server string, snapshotId string, body UpdateSnapshotJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateSnapshotRequestWithBody(server, snapshotId, "application/json", bodyReader) } // NewUpdateSnapshotRequestWithBody generates requests for UpdateSnapshot with any type of body func NewUpdateSnapshotRequestWithBody(server string, snapshotId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "snapshot_id", runtime.ParamLocationPath, snapshotId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewCloneSnapshotRequest calls the generic CloneSnapshot builder with application/json body func NewCloneSnapshotRequest(server string, snapshotId string, body CloneSnapshotJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCloneSnapshotRequestWithBody(server, snapshotId, "application/json", bodyReader) } // NewCloneSnapshotRequestWithBody generates requests for CloneSnapshot with any type of body func NewCloneSnapshotRequestWithBody(server string, snapshotId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "snapshot_id", runtime.ParamLocationPath, snapshotId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/snapshots/%s/clone", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListSSHKeysPaginatedRequest generates requests for ListSSHKeysPaginated func NewListSSHKeysPaginatedRequest(server string, params *ListSSHKeysPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/ssh-keys") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateSSHKeyRequest calls the generic CreateSSHKey builder with application/json body func NewCreateSSHKeyRequest(server string, body CreateSSHKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateSSHKeyRequestWithBody(server, "application/json", bodyReader) } // NewCreateSSHKeyRequestWithBody generates requests for CreateSSHKey with any type of body func NewCreateSSHKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/ssh-keys") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteSSHKeyRequest generates requests for DeleteSSHKey func NewDeleteSSHKeyRequest(server string, sshKeyId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssh_key_id", runtime.ParamLocationPath, sshKeyId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/ssh-keys/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetSSHKeyRequest generates requests for GetSSHKey func NewGetSSHKeyRequest(server string, sshKeyId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssh_key_id", runtime.ParamLocationPath, sshKeyId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/ssh-keys/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateSSHKeyRequest calls the generic UpdateSSHKey builder with application/json body func NewUpdateSSHKeyRequest(server string, sshKeyId string, body UpdateSSHKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateSSHKeyRequestWithBody(server, sshKeyId, "application/json", bodyReader) } // NewUpdateSSHKeyRequestWithBody generates requests for UpdateSSHKey with any type of body func NewUpdateSSHKeyRequestWithBody(server string, sshKeyId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssh_key_id", runtime.ParamLocationPath, sshKeyId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/ssh-keys/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListVolumesPaginatedRequest generates requests for ListVolumesPaginated func NewListVolumesPaginatedRequest(server string, params *ListVolumesPaginatedParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/volumes") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { queryValues := queryURL.Query() if params.Page != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { for k, v := range parsed { for _, v2 := range v { queryValues.Add(k, v2) } } } } queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateVolumeRequest calls the generic CreateVolume builder with application/json body func NewCreateVolumeRequest(server string, body CreateVolumeJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateVolumeRequestWithBody(server, "application/json", bodyReader) } // NewCreateVolumeRequestWithBody generates requests for CreateVolume with any type of body func NewCreateVolumeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/volumes") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteVolumeRequest generates requests for DeleteVolume func NewDeleteVolumeRequest(server string, volumeId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "volume_id", runtime.ParamLocationPath, volumeId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/volumes/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetVolumeRequest generates requests for GetVolume func NewGetVolumeRequest(server string, volumeId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "volume_id", runtime.ParamLocationPath, volumeId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/volumes/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewUpdateVolumeRequest calls the generic UpdateVolume builder with application/json body func NewUpdateVolumeRequest(server string, volumeId string, body UpdateVolumeJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpdateVolumeRequestWithBody(server, volumeId, "application/json", bodyReader) } // NewUpdateVolumeRequestWithBody generates requests for UpdateVolume with any type of body func NewUpdateVolumeRequestWithBody(server string, volumeId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithLocation("simple", false, "volume_id", runtime.ParamLocationPath, volumeId) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/volumes/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { return err } } for _, r := range additionalEditors { if err := r(ctx, req); err != nil { return err } } return nil } // ClientWithResponses builds on ClientInterface to offer response payloads type ClientWithResponses struct { ClientInterface } // NewClientWithResponses creates a new ClientWithResponses, which wraps // Client with return type handling func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { client, err := NewClient(server, opts...) if err != nil { return nil, err } return &ClientWithResponses{client}, nil } // WithBaseURL overrides the baseURL. func WithBaseURL(baseURL string) ClientOption { return func(c *Client) error { newBaseURL, err := url.Parse(baseURL) if err != nil { return err } c.Server = newBaseURL.String() return nil } } // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { // GetInstancesAvailabilityWithResponse request GetInstancesAvailabilityWithResponse(ctx context.Context, region Region, params *GetInstancesAvailabilityParams, reqEditors ...RequestEditorFn) (*GetInstancesAvailabilityResponse, error) // ListFilesystemsPaginatedWithResponse request ListFilesystemsPaginatedWithResponse(ctx context.Context, params *ListFilesystemsPaginatedParams, reqEditors ...RequestEditorFn) (*ListFilesystemsPaginatedResponse, error) // CreateFilesystemWithBodyWithResponse request with any body CreateFilesystemWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFilesystemResponse, error) CreateFilesystemWithResponse(ctx context.Context, body CreateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFilesystemResponse, error) // DeleteFilesystemWithResponse request DeleteFilesystemWithResponse(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*DeleteFilesystemResponse, error) // GetFilesystemWithResponse request GetFilesystemWithResponse(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*GetFilesystemResponse, error) // UpdateFilesystemWithBodyWithResponse request with any body UpdateFilesystemWithBodyWithResponse(ctx context.Context, filesystemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFilesystemResponse, error) UpdateFilesystemWithResponse(ctx context.Context, filesystemId string, body UpdateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFilesystemResponse, error) // ListFloatingIPsPaginatedWithResponse request ListFloatingIPsPaginatedWithResponse(ctx context.Context, params *ListFloatingIPsPaginatedParams, reqEditors ...RequestEditorFn) (*ListFloatingIPsPaginatedResponse, error) // CreateFloatingIPWithBodyWithResponse request with any body CreateFloatingIPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFloatingIPResponse, error) CreateFloatingIPWithResponse(ctx context.Context, body CreateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFloatingIPResponse, error) // DeleteFloatingIPWithResponse request DeleteFloatingIPWithResponse(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*DeleteFloatingIPResponse, error) // GetFloatingIPWithResponse request GetFloatingIPWithResponse(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*GetFloatingIPResponse, error) // UpdateFloatingIPWithBodyWithResponse request with any body UpdateFloatingIPWithBodyWithResponse(ctx context.Context, floatingIpId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFloatingIPResponse, error) UpdateFloatingIPWithResponse(ctx context.Context, floatingIpId string, body UpdateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFloatingIPResponse, error) // ListImagesPaginatedWithResponse request ListImagesPaginatedWithResponse(ctx context.Context, params *ListImagesPaginatedParams, reqEditors ...RequestEditorFn) (*ListImagesPaginatedResponse, error) // ListInstancesPaginatedWithResponse request ListInstancesPaginatedWithResponse(ctx context.Context, params *ListInstancesPaginatedParams, reqEditors ...RequestEditorFn) (*ListInstancesPaginatedResponse, error) // CreateInstanceWithBodyWithResponse request with any body CreateInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateInstanceResponse, error) CreateInstanceWithResponse(ctx context.Context, body CreateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateInstanceResponse, error) // DeleteInstanceWithResponse request DeleteInstanceWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*DeleteInstanceResponse, error) // GetInstanceWithResponse request GetInstanceWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) // UpdateInstanceWithBodyWithResponse request with any body UpdateInstanceWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInstanceResponse, error) UpdateInstanceWithResponse(ctx context.Context, instanceId string, body UpdateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInstanceResponse, error) // GetInstanceActionsWithResponse request GetInstanceActionsWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceActionsResponse, error) // PerformInstanceActionWithBodyWithResponse request with any body PerformInstanceActionWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PerformInstanceActionResponse, error) PerformInstanceActionWithResponse(ctx context.Context, instanceId string, body PerformInstanceActionJSONRequestBody, reqEditors ...RequestEditorFn) (*PerformInstanceActionResponse, error) // ListInstanceSnapshotsPaginatedWithResponse request ListInstanceSnapshotsPaginatedWithResponse(ctx context.Context, instanceId string, params *ListInstanceSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*ListInstanceSnapshotsPaginatedResponse, error) // CreateInstanceSnapshotWithBodyWithResponse request with any body CreateInstanceSnapshotWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateInstanceSnapshotResponse, error) CreateInstanceSnapshotWithResponse(ctx context.Context, instanceId string, body CreateInstanceSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateInstanceSnapshotResponse, error) // GetInstanceUserMetadataWithResponse request GetInstanceUserMetadataWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceUserMetadataResponse, error) // GetQuotasWithResponse request GetQuotasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetQuotasResponse, error) // GetReservationsWithResponse request GetReservationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetReservationsResponse, error) // ListSecurityGroupsPaginatedWithResponse request ListSecurityGroupsPaginatedWithResponse(ctx context.Context, params *ListSecurityGroupsPaginatedParams, reqEditors ...RequestEditorFn) (*ListSecurityGroupsPaginatedResponse, error) // CreateSecurityGroupWithBodyWithResponse request with any body CreateSecurityGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecurityGroupResponse, error) CreateSecurityGroupWithResponse(ctx context.Context, body CreateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecurityGroupResponse, error) // DeleteSecurityGroupWithResponse request DeleteSecurityGroupWithResponse(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*DeleteSecurityGroupResponse, error) // GetSecurityGroupWithResponse request GetSecurityGroupWithResponse(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*GetSecurityGroupResponse, error) // UpdateSecurityGroupWithBodyWithResponse request with any body UpdateSecurityGroupWithBodyWithResponse(ctx context.Context, securityGroupId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecurityGroupResponse, error) UpdateSecurityGroupWithResponse(ctx context.Context, securityGroupId string, body UpdateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecurityGroupResponse, error) // ListSnapshotsPaginatedWithResponse request ListSnapshotsPaginatedWithResponse(ctx context.Context, params *ListSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*ListSnapshotsPaginatedResponse, error) // CreateSnapshotWithBodyWithResponse request with any body CreateSnapshotWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSnapshotResponse, error) CreateSnapshotWithResponse(ctx context.Context, body CreateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSnapshotResponse, error) // DeleteSnapshotWithResponse request DeleteSnapshotWithResponse(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*DeleteSnapshotResponse, error) // GetSnapshotWithResponse request GetSnapshotWithResponse(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*GetSnapshotResponse, error) // UpdateSnapshotWithBodyWithResponse request with any body UpdateSnapshotWithBodyWithResponse(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSnapshotResponse, error) UpdateSnapshotWithResponse(ctx context.Context, snapshotId string, body UpdateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSnapshotResponse, error) // CloneSnapshotWithBodyWithResponse request with any body CloneSnapshotWithBodyWithResponse(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CloneSnapshotResponse, error) CloneSnapshotWithResponse(ctx context.Context, snapshotId string, body CloneSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CloneSnapshotResponse, error) // ListSSHKeysPaginatedWithResponse request ListSSHKeysPaginatedWithResponse(ctx context.Context, params *ListSSHKeysPaginatedParams, reqEditors ...RequestEditorFn) (*ListSSHKeysPaginatedResponse, error) // CreateSSHKeyWithBodyWithResponse request with any body CreateSSHKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSSHKeyResponse, error) CreateSSHKeyWithResponse(ctx context.Context, body CreateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSSHKeyResponse, error) // DeleteSSHKeyWithResponse request DeleteSSHKeyWithResponse(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*DeleteSSHKeyResponse, error) // GetSSHKeyWithResponse request GetSSHKeyWithResponse(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*GetSSHKeyResponse, error) // UpdateSSHKeyWithBodyWithResponse request with any body UpdateSSHKeyWithBodyWithResponse(ctx context.Context, sshKeyId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSSHKeyResponse, error) UpdateSSHKeyWithResponse(ctx context.Context, sshKeyId string, body UpdateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSSHKeyResponse, error) // ListVolumesPaginatedWithResponse request ListVolumesPaginatedWithResponse(ctx context.Context, params *ListVolumesPaginatedParams, reqEditors ...RequestEditorFn) (*ListVolumesPaginatedResponse, error) // CreateVolumeWithBodyWithResponse request with any body CreateVolumeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVolumeResponse, error) CreateVolumeWithResponse(ctx context.Context, body CreateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVolumeResponse, error) // DeleteVolumeWithResponse request DeleteVolumeWithResponse(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*DeleteVolumeResponse, error) // GetVolumeWithResponse request GetVolumeWithResponse(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*GetVolumeResponse, error) // UpdateVolumeWithBodyWithResponse request with any body UpdateVolumeWithBodyWithResponse(ctx context.Context, volumeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateVolumeResponse, error) UpdateVolumeWithResponse(ctx context.Context, volumeId string, body UpdateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateVolumeResponse, error) } type GetInstancesAvailabilityResponse struct { Body []byte HTTPResponse *http.Response JSON200 *InstancesAvailabilityResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetInstancesAvailabilityResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetInstancesAvailabilityResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListFilesystemsPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedFilesystemsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListFilesystemsPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListFilesystemsPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateFilesystemResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleFilesystemResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateFilesystemResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateFilesystemResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteFilesystemResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteFilesystemResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteFilesystemResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetFilesystemResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleFilesystemResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetFilesystemResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetFilesystemResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateFilesystemResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleFilesystemResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateFilesystemResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateFilesystemResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListFloatingIPsPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedFloatingIPsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListFloatingIPsPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListFloatingIPsPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateFloatingIPResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleFloatingIPResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateFloatingIPResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateFloatingIPResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteFloatingIPResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteFloatingIPResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteFloatingIPResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetFloatingIPResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleFloatingIPResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetFloatingIPResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetFloatingIPResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateFloatingIPResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleFloatingIPResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateFloatingIPResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateFloatingIPResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListImagesPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedImagesResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListImagesPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListImagesPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListInstancesPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedInstancesResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListInstancesPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListInstancesPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateInstanceResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleInstanceResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteInstanceResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetInstanceResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleInstanceResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateInstanceResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleInstanceResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetInstanceActionsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *InstanceGetActionsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetInstanceActionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetInstanceActionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type PerformInstanceActionResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r PerformInstanceActionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PerformInstanceActionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListInstanceSnapshotsPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedSnapshotsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListInstanceSnapshotsPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListInstanceSnapshotsPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateInstanceSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleSnapshotResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateInstanceSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateInstanceSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetInstanceUserMetadataResponse struct { Body []byte HTTPResponse *http.Response JSON200 *InstanceGetInstanceUserMetadataResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetInstanceUserMetadataResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetInstanceUserMetadataResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetQuotasResponse struct { Body []byte HTTPResponse *http.Response JSON200 *QuotasResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetQuotasResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetQuotasResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetReservationsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ReservationsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetReservationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReservationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListSecurityGroupsPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedSecurityGroupsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListSecurityGroupsPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListSecurityGroupsPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateSecurityGroupResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleSecurityGroupResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateSecurityGroupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateSecurityGroupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteSecurityGroupResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteSecurityGroupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteSecurityGroupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetSecurityGroupResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSecurityGroupResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetSecurityGroupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetSecurityGroupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateSecurityGroupResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSecurityGroupResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateSecurityGroupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateSecurityGroupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListSnapshotsPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedSnapshotsResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListSnapshotsPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListSnapshotsPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleSnapshotResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSnapshotResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSnapshotResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CloneSnapshotResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleSnapshotResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CloneSnapshotResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CloneSnapshotResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListSSHKeysPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedSSHKeysResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListSSHKeysPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListSSHKeysPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateSSHKeyResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleSSHKeyResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateSSHKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateSSHKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteSSHKeyResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteSSHKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteSSHKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetSSHKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSSHKeyResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetSSHKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetSSHKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateSSHKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleSSHKeyResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateSSHKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateSSHKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type ListVolumesPaginatedResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PaginatedVolumesResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r ListVolumesPaginatedResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListVolumesPaginatedResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type CreateVolumeResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SingleVolumeResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r CreateVolumeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateVolumeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type DeleteVolumeResponse struct { Body []byte HTTPResponse *http.Response JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r DeleteVolumeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteVolumeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type GetVolumeResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleVolumeResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r GetVolumeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetVolumeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } type UpdateVolumeResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SingleVolumeResponse JSONDefault *ErrorResponse } // Status returns HTTPResponse.Status func (r UpdateVolumeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r UpdateVolumeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // GetInstancesAvailabilityWithResponse request returning *GetInstancesAvailabilityResponse func (c *ClientWithResponses) GetInstancesAvailabilityWithResponse(ctx context.Context, region Region, params *GetInstancesAvailabilityParams, reqEditors ...RequestEditorFn) (*GetInstancesAvailabilityResponse, error) { rsp, err := c.GetInstancesAvailability(ctx, region, params, reqEditors...) if err != nil { return nil, err } return ParseGetInstancesAvailabilityResponse(rsp) } // ListFilesystemsPaginatedWithResponse request returning *ListFilesystemsPaginatedResponse func (c *ClientWithResponses) ListFilesystemsPaginatedWithResponse(ctx context.Context, params *ListFilesystemsPaginatedParams, reqEditors ...RequestEditorFn) (*ListFilesystemsPaginatedResponse, error) { rsp, err := c.ListFilesystemsPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListFilesystemsPaginatedResponse(rsp) } // CreateFilesystemWithBodyWithResponse request with arbitrary body returning *CreateFilesystemResponse func (c *ClientWithResponses) CreateFilesystemWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFilesystemResponse, error) { rsp, err := c.CreateFilesystemWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateFilesystemResponse(rsp) } func (c *ClientWithResponses) CreateFilesystemWithResponse(ctx context.Context, body CreateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFilesystemResponse, error) { rsp, err := c.CreateFilesystem(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateFilesystemResponse(rsp) } // DeleteFilesystemWithResponse request returning *DeleteFilesystemResponse func (c *ClientWithResponses) DeleteFilesystemWithResponse(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*DeleteFilesystemResponse, error) { rsp, err := c.DeleteFilesystem(ctx, filesystemId, reqEditors...) if err != nil { return nil, err } return ParseDeleteFilesystemResponse(rsp) } // GetFilesystemWithResponse request returning *GetFilesystemResponse func (c *ClientWithResponses) GetFilesystemWithResponse(ctx context.Context, filesystemId string, reqEditors ...RequestEditorFn) (*GetFilesystemResponse, error) { rsp, err := c.GetFilesystem(ctx, filesystemId, reqEditors...) if err != nil { return nil, err } return ParseGetFilesystemResponse(rsp) } // UpdateFilesystemWithBodyWithResponse request with arbitrary body returning *UpdateFilesystemResponse func (c *ClientWithResponses) UpdateFilesystemWithBodyWithResponse(ctx context.Context, filesystemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFilesystemResponse, error) { rsp, err := c.UpdateFilesystemWithBody(ctx, filesystemId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateFilesystemResponse(rsp) } func (c *ClientWithResponses) UpdateFilesystemWithResponse(ctx context.Context, filesystemId string, body UpdateFilesystemJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFilesystemResponse, error) { rsp, err := c.UpdateFilesystem(ctx, filesystemId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateFilesystemResponse(rsp) } // ListFloatingIPsPaginatedWithResponse request returning *ListFloatingIPsPaginatedResponse func (c *ClientWithResponses) ListFloatingIPsPaginatedWithResponse(ctx context.Context, params *ListFloatingIPsPaginatedParams, reqEditors ...RequestEditorFn) (*ListFloatingIPsPaginatedResponse, error) { rsp, err := c.ListFloatingIPsPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListFloatingIPsPaginatedResponse(rsp) } // CreateFloatingIPWithBodyWithResponse request with arbitrary body returning *CreateFloatingIPResponse func (c *ClientWithResponses) CreateFloatingIPWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFloatingIPResponse, error) { rsp, err := c.CreateFloatingIPWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateFloatingIPResponse(rsp) } func (c *ClientWithResponses) CreateFloatingIPWithResponse(ctx context.Context, body CreateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFloatingIPResponse, error) { rsp, err := c.CreateFloatingIP(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateFloatingIPResponse(rsp) } // DeleteFloatingIPWithResponse request returning *DeleteFloatingIPResponse func (c *ClientWithResponses) DeleteFloatingIPWithResponse(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*DeleteFloatingIPResponse, error) { rsp, err := c.DeleteFloatingIP(ctx, floatingIpId, reqEditors...) if err != nil { return nil, err } return ParseDeleteFloatingIPResponse(rsp) } // GetFloatingIPWithResponse request returning *GetFloatingIPResponse func (c *ClientWithResponses) GetFloatingIPWithResponse(ctx context.Context, floatingIpId string, reqEditors ...RequestEditorFn) (*GetFloatingIPResponse, error) { rsp, err := c.GetFloatingIP(ctx, floatingIpId, reqEditors...) if err != nil { return nil, err } return ParseGetFloatingIPResponse(rsp) } // UpdateFloatingIPWithBodyWithResponse request with arbitrary body returning *UpdateFloatingIPResponse func (c *ClientWithResponses) UpdateFloatingIPWithBodyWithResponse(ctx context.Context, floatingIpId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFloatingIPResponse, error) { rsp, err := c.UpdateFloatingIPWithBody(ctx, floatingIpId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateFloatingIPResponse(rsp) } func (c *ClientWithResponses) UpdateFloatingIPWithResponse(ctx context.Context, floatingIpId string, body UpdateFloatingIPJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFloatingIPResponse, error) { rsp, err := c.UpdateFloatingIP(ctx, floatingIpId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateFloatingIPResponse(rsp) } // ListImagesPaginatedWithResponse request returning *ListImagesPaginatedResponse func (c *ClientWithResponses) ListImagesPaginatedWithResponse(ctx context.Context, params *ListImagesPaginatedParams, reqEditors ...RequestEditorFn) (*ListImagesPaginatedResponse, error) { rsp, err := c.ListImagesPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListImagesPaginatedResponse(rsp) } // ListInstancesPaginatedWithResponse request returning *ListInstancesPaginatedResponse func (c *ClientWithResponses) ListInstancesPaginatedWithResponse(ctx context.Context, params *ListInstancesPaginatedParams, reqEditors ...RequestEditorFn) (*ListInstancesPaginatedResponse, error) { rsp, err := c.ListInstancesPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListInstancesPaginatedResponse(rsp) } // CreateInstanceWithBodyWithResponse request with arbitrary body returning *CreateInstanceResponse func (c *ClientWithResponses) CreateInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateInstanceResponse, error) { rsp, err := c.CreateInstanceWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateInstanceResponse(rsp) } func (c *ClientWithResponses) CreateInstanceWithResponse(ctx context.Context, body CreateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateInstanceResponse, error) { rsp, err := c.CreateInstance(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateInstanceResponse(rsp) } // DeleteInstanceWithResponse request returning *DeleteInstanceResponse func (c *ClientWithResponses) DeleteInstanceWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*DeleteInstanceResponse, error) { rsp, err := c.DeleteInstance(ctx, instanceId, reqEditors...) if err != nil { return nil, err } return ParseDeleteInstanceResponse(rsp) } // GetInstanceWithResponse request returning *GetInstanceResponse func (c *ClientWithResponses) GetInstanceWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) { rsp, err := c.GetInstance(ctx, instanceId, reqEditors...) if err != nil { return nil, err } return ParseGetInstanceResponse(rsp) } // UpdateInstanceWithBodyWithResponse request with arbitrary body returning *UpdateInstanceResponse func (c *ClientWithResponses) UpdateInstanceWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInstanceResponse, error) { rsp, err := c.UpdateInstanceWithBody(ctx, instanceId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateInstanceResponse(rsp) } func (c *ClientWithResponses) UpdateInstanceWithResponse(ctx context.Context, instanceId string, body UpdateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInstanceResponse, error) { rsp, err := c.UpdateInstance(ctx, instanceId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateInstanceResponse(rsp) } // GetInstanceActionsWithResponse request returning *GetInstanceActionsResponse func (c *ClientWithResponses) GetInstanceActionsWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceActionsResponse, error) { rsp, err := c.GetInstanceActions(ctx, instanceId, reqEditors...) if err != nil { return nil, err } return ParseGetInstanceActionsResponse(rsp) } // PerformInstanceActionWithBodyWithResponse request with arbitrary body returning *PerformInstanceActionResponse func (c *ClientWithResponses) PerformInstanceActionWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PerformInstanceActionResponse, error) { rsp, err := c.PerformInstanceActionWithBody(ctx, instanceId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePerformInstanceActionResponse(rsp) } func (c *ClientWithResponses) PerformInstanceActionWithResponse(ctx context.Context, instanceId string, body PerformInstanceActionJSONRequestBody, reqEditors ...RequestEditorFn) (*PerformInstanceActionResponse, error) { rsp, err := c.PerformInstanceAction(ctx, instanceId, body, reqEditors...) if err != nil { return nil, err } return ParsePerformInstanceActionResponse(rsp) } // ListInstanceSnapshotsPaginatedWithResponse request returning *ListInstanceSnapshotsPaginatedResponse func (c *ClientWithResponses) ListInstanceSnapshotsPaginatedWithResponse(ctx context.Context, instanceId string, params *ListInstanceSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*ListInstanceSnapshotsPaginatedResponse, error) { rsp, err := c.ListInstanceSnapshotsPaginated(ctx, instanceId, params, reqEditors...) if err != nil { return nil, err } return ParseListInstanceSnapshotsPaginatedResponse(rsp) } // CreateInstanceSnapshotWithBodyWithResponse request with arbitrary body returning *CreateInstanceSnapshotResponse func (c *ClientWithResponses) CreateInstanceSnapshotWithBodyWithResponse(ctx context.Context, instanceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateInstanceSnapshotResponse, error) { rsp, err := c.CreateInstanceSnapshotWithBody(ctx, instanceId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateInstanceSnapshotResponse(rsp) } func (c *ClientWithResponses) CreateInstanceSnapshotWithResponse(ctx context.Context, instanceId string, body CreateInstanceSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateInstanceSnapshotResponse, error) { rsp, err := c.CreateInstanceSnapshot(ctx, instanceId, body, reqEditors...) if err != nil { return nil, err } return ParseCreateInstanceSnapshotResponse(rsp) } // GetInstanceUserMetadataWithResponse request returning *GetInstanceUserMetadataResponse func (c *ClientWithResponses) GetInstanceUserMetadataWithResponse(ctx context.Context, instanceId string, reqEditors ...RequestEditorFn) (*GetInstanceUserMetadataResponse, error) { rsp, err := c.GetInstanceUserMetadata(ctx, instanceId, reqEditors...) if err != nil { return nil, err } return ParseGetInstanceUserMetadataResponse(rsp) } // GetQuotasWithResponse request returning *GetQuotasResponse func (c *ClientWithResponses) GetQuotasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetQuotasResponse, error) { rsp, err := c.GetQuotas(ctx, reqEditors...) if err != nil { return nil, err } return ParseGetQuotasResponse(rsp) } // GetReservationsWithResponse request returning *GetReservationsResponse func (c *ClientWithResponses) GetReservationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetReservationsResponse, error) { rsp, err := c.GetReservations(ctx, reqEditors...) if err != nil { return nil, err } return ParseGetReservationsResponse(rsp) } // ListSecurityGroupsPaginatedWithResponse request returning *ListSecurityGroupsPaginatedResponse func (c *ClientWithResponses) ListSecurityGroupsPaginatedWithResponse(ctx context.Context, params *ListSecurityGroupsPaginatedParams, reqEditors ...RequestEditorFn) (*ListSecurityGroupsPaginatedResponse, error) { rsp, err := c.ListSecurityGroupsPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListSecurityGroupsPaginatedResponse(rsp) } // CreateSecurityGroupWithBodyWithResponse request with arbitrary body returning *CreateSecurityGroupResponse func (c *ClientWithResponses) CreateSecurityGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecurityGroupResponse, error) { rsp, err := c.CreateSecurityGroupWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSecurityGroupResponse(rsp) } func (c *ClientWithResponses) CreateSecurityGroupWithResponse(ctx context.Context, body CreateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecurityGroupResponse, error) { rsp, err := c.CreateSecurityGroup(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSecurityGroupResponse(rsp) } // DeleteSecurityGroupWithResponse request returning *DeleteSecurityGroupResponse func (c *ClientWithResponses) DeleteSecurityGroupWithResponse(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*DeleteSecurityGroupResponse, error) { rsp, err := c.DeleteSecurityGroup(ctx, securityGroupId, reqEditors...) if err != nil { return nil, err } return ParseDeleteSecurityGroupResponse(rsp) } // GetSecurityGroupWithResponse request returning *GetSecurityGroupResponse func (c *ClientWithResponses) GetSecurityGroupWithResponse(ctx context.Context, securityGroupId string, reqEditors ...RequestEditorFn) (*GetSecurityGroupResponse, error) { rsp, err := c.GetSecurityGroup(ctx, securityGroupId, reqEditors...) if err != nil { return nil, err } return ParseGetSecurityGroupResponse(rsp) } // UpdateSecurityGroupWithBodyWithResponse request with arbitrary body returning *UpdateSecurityGroupResponse func (c *ClientWithResponses) UpdateSecurityGroupWithBodyWithResponse(ctx context.Context, securityGroupId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecurityGroupResponse, error) { rsp, err := c.UpdateSecurityGroupWithBody(ctx, securityGroupId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSecurityGroupResponse(rsp) } func (c *ClientWithResponses) UpdateSecurityGroupWithResponse(ctx context.Context, securityGroupId string, body UpdateSecurityGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecurityGroupResponse, error) { rsp, err := c.UpdateSecurityGroup(ctx, securityGroupId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSecurityGroupResponse(rsp) } // ListSnapshotsPaginatedWithResponse request returning *ListSnapshotsPaginatedResponse func (c *ClientWithResponses) ListSnapshotsPaginatedWithResponse(ctx context.Context, params *ListSnapshotsPaginatedParams, reqEditors ...RequestEditorFn) (*ListSnapshotsPaginatedResponse, error) { rsp, err := c.ListSnapshotsPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListSnapshotsPaginatedResponse(rsp) } // CreateSnapshotWithBodyWithResponse request with arbitrary body returning *CreateSnapshotResponse func (c *ClientWithResponses) CreateSnapshotWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSnapshotResponse, error) { rsp, err := c.CreateSnapshotWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSnapshotResponse(rsp) } func (c *ClientWithResponses) CreateSnapshotWithResponse(ctx context.Context, body CreateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSnapshotResponse, error) { rsp, err := c.CreateSnapshot(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSnapshotResponse(rsp) } // DeleteSnapshotWithResponse request returning *DeleteSnapshotResponse func (c *ClientWithResponses) DeleteSnapshotWithResponse(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*DeleteSnapshotResponse, error) { rsp, err := c.DeleteSnapshot(ctx, snapshotId, reqEditors...) if err != nil { return nil, err } return ParseDeleteSnapshotResponse(rsp) } // GetSnapshotWithResponse request returning *GetSnapshotResponse func (c *ClientWithResponses) GetSnapshotWithResponse(ctx context.Context, snapshotId string, reqEditors ...RequestEditorFn) (*GetSnapshotResponse, error) { rsp, err := c.GetSnapshot(ctx, snapshotId, reqEditors...) if err != nil { return nil, err } return ParseGetSnapshotResponse(rsp) } // UpdateSnapshotWithBodyWithResponse request with arbitrary body returning *UpdateSnapshotResponse func (c *ClientWithResponses) UpdateSnapshotWithBodyWithResponse(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSnapshotResponse, error) { rsp, err := c.UpdateSnapshotWithBody(ctx, snapshotId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSnapshotResponse(rsp) } func (c *ClientWithResponses) UpdateSnapshotWithResponse(ctx context.Context, snapshotId string, body UpdateSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSnapshotResponse, error) { rsp, err := c.UpdateSnapshot(ctx, snapshotId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSnapshotResponse(rsp) } // CloneSnapshotWithBodyWithResponse request with arbitrary body returning *CloneSnapshotResponse func (c *ClientWithResponses) CloneSnapshotWithBodyWithResponse(ctx context.Context, snapshotId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CloneSnapshotResponse, error) { rsp, err := c.CloneSnapshotWithBody(ctx, snapshotId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCloneSnapshotResponse(rsp) } func (c *ClientWithResponses) CloneSnapshotWithResponse(ctx context.Context, snapshotId string, body CloneSnapshotJSONRequestBody, reqEditors ...RequestEditorFn) (*CloneSnapshotResponse, error) { rsp, err := c.CloneSnapshot(ctx, snapshotId, body, reqEditors...) if err != nil { return nil, err } return ParseCloneSnapshotResponse(rsp) } // ListSSHKeysPaginatedWithResponse request returning *ListSSHKeysPaginatedResponse func (c *ClientWithResponses) ListSSHKeysPaginatedWithResponse(ctx context.Context, params *ListSSHKeysPaginatedParams, reqEditors ...RequestEditorFn) (*ListSSHKeysPaginatedResponse, error) { rsp, err := c.ListSSHKeysPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListSSHKeysPaginatedResponse(rsp) } // CreateSSHKeyWithBodyWithResponse request with arbitrary body returning *CreateSSHKeyResponse func (c *ClientWithResponses) CreateSSHKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSSHKeyResponse, error) { rsp, err := c.CreateSSHKeyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSSHKeyResponse(rsp) } func (c *ClientWithResponses) CreateSSHKeyWithResponse(ctx context.Context, body CreateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSSHKeyResponse, error) { rsp, err := c.CreateSSHKey(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateSSHKeyResponse(rsp) } // DeleteSSHKeyWithResponse request returning *DeleteSSHKeyResponse func (c *ClientWithResponses) DeleteSSHKeyWithResponse(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*DeleteSSHKeyResponse, error) { rsp, err := c.DeleteSSHKey(ctx, sshKeyId, reqEditors...) if err != nil { return nil, err } return ParseDeleteSSHKeyResponse(rsp) } // GetSSHKeyWithResponse request returning *GetSSHKeyResponse func (c *ClientWithResponses) GetSSHKeyWithResponse(ctx context.Context, sshKeyId string, reqEditors ...RequestEditorFn) (*GetSSHKeyResponse, error) { rsp, err := c.GetSSHKey(ctx, sshKeyId, reqEditors...) if err != nil { return nil, err } return ParseGetSSHKeyResponse(rsp) } // UpdateSSHKeyWithBodyWithResponse request with arbitrary body returning *UpdateSSHKeyResponse func (c *ClientWithResponses) UpdateSSHKeyWithBodyWithResponse(ctx context.Context, sshKeyId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSSHKeyResponse, error) { rsp, err := c.UpdateSSHKeyWithBody(ctx, sshKeyId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSSHKeyResponse(rsp) } func (c *ClientWithResponses) UpdateSSHKeyWithResponse(ctx context.Context, sshKeyId string, body UpdateSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSSHKeyResponse, error) { rsp, err := c.UpdateSSHKey(ctx, sshKeyId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateSSHKeyResponse(rsp) } // ListVolumesPaginatedWithResponse request returning *ListVolumesPaginatedResponse func (c *ClientWithResponses) ListVolumesPaginatedWithResponse(ctx context.Context, params *ListVolumesPaginatedParams, reqEditors ...RequestEditorFn) (*ListVolumesPaginatedResponse, error) { rsp, err := c.ListVolumesPaginated(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListVolumesPaginatedResponse(rsp) } // CreateVolumeWithBodyWithResponse request with arbitrary body returning *CreateVolumeResponse func (c *ClientWithResponses) CreateVolumeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVolumeResponse, error) { rsp, err := c.CreateVolumeWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateVolumeResponse(rsp) } func (c *ClientWithResponses) CreateVolumeWithResponse(ctx context.Context, body CreateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVolumeResponse, error) { rsp, err := c.CreateVolume(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateVolumeResponse(rsp) } // DeleteVolumeWithResponse request returning *DeleteVolumeResponse func (c *ClientWithResponses) DeleteVolumeWithResponse(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*DeleteVolumeResponse, error) { rsp, err := c.DeleteVolume(ctx, volumeId, reqEditors...) if err != nil { return nil, err } return ParseDeleteVolumeResponse(rsp) } // GetVolumeWithResponse request returning *GetVolumeResponse func (c *ClientWithResponses) GetVolumeWithResponse(ctx context.Context, volumeId string, reqEditors ...RequestEditorFn) (*GetVolumeResponse, error) { rsp, err := c.GetVolume(ctx, volumeId, reqEditors...) if err != nil { return nil, err } return ParseGetVolumeResponse(rsp) } // UpdateVolumeWithBodyWithResponse request with arbitrary body returning *UpdateVolumeResponse func (c *ClientWithResponses) UpdateVolumeWithBodyWithResponse(ctx context.Context, volumeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateVolumeResponse, error) { rsp, err := c.UpdateVolumeWithBody(ctx, volumeId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateVolumeResponse(rsp) } func (c *ClientWithResponses) UpdateVolumeWithResponse(ctx context.Context, volumeId string, body UpdateVolumeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateVolumeResponse, error) { rsp, err := c.UpdateVolume(ctx, volumeId, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateVolumeResponse(rsp) } // ParseGetInstancesAvailabilityResponse parses an HTTP response from a GetInstancesAvailabilityWithResponse call func ParseGetInstancesAvailabilityResponse(rsp *http.Response) (*GetInstancesAvailabilityResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetInstancesAvailabilityResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest InstancesAvailabilityResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListFilesystemsPaginatedResponse parses an HTTP response from a ListFilesystemsPaginatedWithResponse call func ParseListFilesystemsPaginatedResponse(rsp *http.Response) (*ListFilesystemsPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListFilesystemsPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedFilesystemsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateFilesystemResponse parses an HTTP response from a CreateFilesystemWithResponse call func ParseCreateFilesystemResponse(rsp *http.Response) (*CreateFilesystemResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateFilesystemResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleFilesystemResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteFilesystemResponse parses an HTTP response from a DeleteFilesystemWithResponse call func ParseDeleteFilesystemResponse(rsp *http.Response) (*DeleteFilesystemResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteFilesystemResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetFilesystemResponse parses an HTTP response from a GetFilesystemWithResponse call func ParseGetFilesystemResponse(rsp *http.Response) (*GetFilesystemResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetFilesystemResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleFilesystemResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateFilesystemResponse parses an HTTP response from a UpdateFilesystemWithResponse call func ParseUpdateFilesystemResponse(rsp *http.Response) (*UpdateFilesystemResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateFilesystemResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleFilesystemResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListFloatingIPsPaginatedResponse parses an HTTP response from a ListFloatingIPsPaginatedWithResponse call func ParseListFloatingIPsPaginatedResponse(rsp *http.Response) (*ListFloatingIPsPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListFloatingIPsPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedFloatingIPsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateFloatingIPResponse parses an HTTP response from a CreateFloatingIPWithResponse call func ParseCreateFloatingIPResponse(rsp *http.Response) (*CreateFloatingIPResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateFloatingIPResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleFloatingIPResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteFloatingIPResponse parses an HTTP response from a DeleteFloatingIPWithResponse call func ParseDeleteFloatingIPResponse(rsp *http.Response) (*DeleteFloatingIPResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteFloatingIPResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetFloatingIPResponse parses an HTTP response from a GetFloatingIPWithResponse call func ParseGetFloatingIPResponse(rsp *http.Response) (*GetFloatingIPResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetFloatingIPResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleFloatingIPResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateFloatingIPResponse parses an HTTP response from a UpdateFloatingIPWithResponse call func ParseUpdateFloatingIPResponse(rsp *http.Response) (*UpdateFloatingIPResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateFloatingIPResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleFloatingIPResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListImagesPaginatedResponse parses an HTTP response from a ListImagesPaginatedWithResponse call func ParseListImagesPaginatedResponse(rsp *http.Response) (*ListImagesPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListImagesPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedImagesResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListInstancesPaginatedResponse parses an HTTP response from a ListInstancesPaginatedWithResponse call func ParseListInstancesPaginatedResponse(rsp *http.Response) (*ListInstancesPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListInstancesPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedInstancesResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateInstanceResponse parses an HTTP response from a CreateInstanceWithResponse call func ParseCreateInstanceResponse(rsp *http.Response) (*CreateInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleInstanceResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteInstanceResponse parses an HTTP response from a DeleteInstanceWithResponse call func ParseDeleteInstanceResponse(rsp *http.Response) (*DeleteInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetInstanceResponse parses an HTTP response from a GetInstanceWithResponse call func ParseGetInstanceResponse(rsp *http.Response) (*GetInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleInstanceResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateInstanceResponse parses an HTTP response from a UpdateInstanceWithResponse call func ParseUpdateInstanceResponse(rsp *http.Response) (*UpdateInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleInstanceResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetInstanceActionsResponse parses an HTTP response from a GetInstanceActionsWithResponse call func ParseGetInstanceActionsResponse(rsp *http.Response) (*GetInstanceActionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetInstanceActionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest InstanceGetActionsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParsePerformInstanceActionResponse parses an HTTP response from a PerformInstanceActionWithResponse call func ParsePerformInstanceActionResponse(rsp *http.Response) (*PerformInstanceActionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PerformInstanceActionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListInstanceSnapshotsPaginatedResponse parses an HTTP response from a ListInstanceSnapshotsPaginatedWithResponse call func ParseListInstanceSnapshotsPaginatedResponse(rsp *http.Response) (*ListInstanceSnapshotsPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListInstanceSnapshotsPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedSnapshotsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateInstanceSnapshotResponse parses an HTTP response from a CreateInstanceSnapshotWithResponse call func ParseCreateInstanceSnapshotResponse(rsp *http.Response) (*CreateInstanceSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateInstanceSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleSnapshotResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetInstanceUserMetadataResponse parses an HTTP response from a GetInstanceUserMetadataWithResponse call func ParseGetInstanceUserMetadataResponse(rsp *http.Response) (*GetInstanceUserMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetInstanceUserMetadataResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest InstanceGetInstanceUserMetadataResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetQuotasResponse parses an HTTP response from a GetQuotasWithResponse call func ParseGetQuotasResponse(rsp *http.Response) (*GetQuotasResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetQuotasResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest QuotasResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetReservationsResponse parses an HTTP response from a GetReservationsWithResponse call func ParseGetReservationsResponse(rsp *http.Response) (*GetReservationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReservationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ReservationsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListSecurityGroupsPaginatedResponse parses an HTTP response from a ListSecurityGroupsPaginatedWithResponse call func ParseListSecurityGroupsPaginatedResponse(rsp *http.Response) (*ListSecurityGroupsPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListSecurityGroupsPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedSecurityGroupsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateSecurityGroupResponse parses an HTTP response from a CreateSecurityGroupWithResponse call func ParseCreateSecurityGroupResponse(rsp *http.Response) (*CreateSecurityGroupResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateSecurityGroupResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleSecurityGroupResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteSecurityGroupResponse parses an HTTP response from a DeleteSecurityGroupWithResponse call func ParseDeleteSecurityGroupResponse(rsp *http.Response) (*DeleteSecurityGroupResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteSecurityGroupResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetSecurityGroupResponse parses an HTTP response from a GetSecurityGroupWithResponse call func ParseGetSecurityGroupResponse(rsp *http.Response) (*GetSecurityGroupResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetSecurityGroupResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSecurityGroupResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateSecurityGroupResponse parses an HTTP response from a UpdateSecurityGroupWithResponse call func ParseUpdateSecurityGroupResponse(rsp *http.Response) (*UpdateSecurityGroupResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateSecurityGroupResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSecurityGroupResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListSnapshotsPaginatedResponse parses an HTTP response from a ListSnapshotsPaginatedWithResponse call func ParseListSnapshotsPaginatedResponse(rsp *http.Response) (*ListSnapshotsPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListSnapshotsPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedSnapshotsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateSnapshotResponse parses an HTTP response from a CreateSnapshotWithResponse call func ParseCreateSnapshotResponse(rsp *http.Response) (*CreateSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleSnapshotResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteSnapshotResponse parses an HTTP response from a DeleteSnapshotWithResponse call func ParseDeleteSnapshotResponse(rsp *http.Response) (*DeleteSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetSnapshotResponse parses an HTTP response from a GetSnapshotWithResponse call func ParseGetSnapshotResponse(rsp *http.Response) (*GetSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSnapshotResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateSnapshotResponse parses an HTTP response from a UpdateSnapshotWithResponse call func ParseUpdateSnapshotResponse(rsp *http.Response) (*UpdateSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSnapshotResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCloneSnapshotResponse parses an HTTP response from a CloneSnapshotWithResponse call func ParseCloneSnapshotResponse(rsp *http.Response) (*CloneSnapshotResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CloneSnapshotResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleSnapshotResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListSSHKeysPaginatedResponse parses an HTTP response from a ListSSHKeysPaginatedWithResponse call func ParseListSSHKeysPaginatedResponse(rsp *http.Response) (*ListSSHKeysPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListSSHKeysPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedSSHKeysResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateSSHKeyResponse parses an HTTP response from a CreateSSHKeyWithResponse call func ParseCreateSSHKeyResponse(rsp *http.Response) (*CreateSSHKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateSSHKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleSSHKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteSSHKeyResponse parses an HTTP response from a DeleteSSHKeyWithResponse call func ParseDeleteSSHKeyResponse(rsp *http.Response) (*DeleteSSHKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteSSHKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetSSHKeyResponse parses an HTTP response from a GetSSHKeyWithResponse call func ParseGetSSHKeyResponse(rsp *http.Response) (*GetSSHKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetSSHKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSSHKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateSSHKeyResponse parses an HTTP response from a UpdateSSHKeyWithResponse call func ParseUpdateSSHKeyResponse(rsp *http.Response) (*UpdateSSHKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateSSHKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleSSHKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseListVolumesPaginatedResponse parses an HTTP response from a ListVolumesPaginatedWithResponse call func ParseListVolumesPaginatedResponse(rsp *http.Response) (*ListVolumesPaginatedResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListVolumesPaginatedResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PaginatedVolumesResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseCreateVolumeResponse parses an HTTP response from a CreateVolumeWithResponse call func ParseCreateVolumeResponse(rsp *http.Response) (*CreateVolumeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateVolumeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest SingleVolumeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseDeleteVolumeResponse parses an HTTP response from a DeleteVolumeWithResponse call func ParseDeleteVolumeResponse(rsp *http.Response) (*DeleteVolumeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteVolumeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseGetVolumeResponse parses an HTTP response from a GetVolumeWithResponse call func ParseGetVolumeResponse(rsp *http.Response) (*GetVolumeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetVolumeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleVolumeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil } // ParseUpdateVolumeResponse parses an HTTP response from a UpdateVolumeWithResponse call func ParseUpdateVolumeResponse(rsp *http.Response) (*UpdateVolumeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &UpdateVolumeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest SingleVolumeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSONDefault = &dest } return response, nil }